inl-ui 0.0.4 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/.babelrc +3 -3
  2. package/README.md +28 -1
  3. package/dist/index.js +12707 -67
  4. package/dist/index.js.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/dist/theme/dark.less +204 -182
  7. package/dist/theme/default.less +109 -1067
  8. package/package.json +38 -36
  9. package/conf/config.output.ts +0 -0
  10. package/conf/cp.js +0 -51
  11. package/conf/rollup.config.ts +0 -36
  12. package/dist/theme/dark copy.less +0 -448
  13. package/dist/types/src/components/index.d.ts +0 -2
  14. package/dist/types/src/index.d.ts +0 -7
  15. package/dist/types/src/pageComponent/api/auth/menuManager.d.ts +0 -23
  16. package/dist/types/src/pageComponent/api/auth/roleManager.d.ts +0 -27
  17. package/dist/types/src/pageComponent/api/auth/userManager.d.ts +0 -45
  18. package/dist/types/src/pageComponent/api/axios.d.ts +0 -4
  19. package/dist/types/src/pageComponent/api/index.d.ts +0 -30
  20. package/dist/types/src/pageComponent/api/logManager.d.ts +0 -11
  21. package/dist/types/src/pageComponent/api/org/depManager.d.ts +0 -55
  22. package/dist/types/src/pageComponent/api/org/postManager.d.ts +0 -30
  23. package/dist/types/src/pageComponent/api/org/teamManager.d.ts +0 -38
  24. package/dist/types/src/pageComponent/api/param.d.ts +0 -32
  25. package/dist/types/src/pageComponent/components/CommonTree.d.ts +0 -57
  26. package/dist/types/src/pageComponent/components/DynamicIcon.d.ts +0 -13
  27. package/dist/types/src/pageComponent/components/EditPasswordForm.d.ts +0 -19
  28. package/dist/types/src/pageComponent/components/IconSelect.d.ts +0 -12
  29. package/dist/types/src/pageComponent/components/Navbar.d.ts +0 -13
  30. package/dist/types/src/pageComponent/components/ProFormItem.d.ts +0 -18
  31. package/dist/types/src/pageComponent/components/SearchSelect.d.ts +0 -49
  32. package/dist/types/src/pageComponent/components/Sidebar.d.ts +0 -20
  33. package/dist/types/src/pageComponent/components/loginBox/index.d.ts +0 -43
  34. package/dist/types/src/pageComponent/config/global.d.ts +0 -7
  35. package/dist/types/src/pageComponent/config/install.d.ts +0 -2
  36. package/dist/types/src/pageComponent/hooks/global.d.ts +0 -6
  37. package/dist/types/src/pageComponent/hooks/manage-module/useModalForm.d.ts +0 -5
  38. package/dist/types/src/pageComponent/hooks/manage-module/useModalTitle.d.ts +0 -6
  39. package/dist/types/src/pageComponent/hooks/manage-module/useModalVisibleControl.d.ts +0 -5
  40. package/dist/types/src/pageComponent/hooks/useBus.d.ts +0 -6
  41. package/dist/types/src/pageComponent/hooks/useProxy.d.ts +0 -4
  42. package/dist/types/src/pageComponent/hooks/useTableList.d.ts +0 -13
  43. package/dist/types/src/pageComponent/hooks/useVModel.d.ts +0 -1
  44. package/dist/types/src/pageComponent/index.d.ts +0 -2
  45. package/dist/types/src/pageComponent/utils/base64.d.ts +0 -14
  46. package/dist/types/src/pageComponent/utils/index.d.ts +0 -3
  47. package/dist/types/src/pageComponent/utils/is.d.ts +0 -10
  48. package/dist/types/src/pageComponent/utils/transform.d.ts +0 -10
  49. package/dist/types/src/pageComponent/utils/tree.d.ts +0 -16
  50. package/dist/types/src/pageComponent/utils/validation.d.ts +0 -11
  51. package/dist/types/src/pageComponent/views/alarms/index.d.ts +0 -2
  52. package/dist/types/src/pageComponent/views/index.d.ts +0 -2
  53. package/dist/types/src/pageComponent/views/login.d.ts +0 -2
  54. package/dist/types/src/pageComponent/views/systemManager/about.d.ts +0 -2
  55. package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/index.d.ts +0 -5
  56. package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/menuDetail.d.ts +0 -10
  57. package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/menuSelectTree.d.ts +0 -18
  58. package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/updateMenuDialog.d.ts +0 -27
  59. package/dist/types/src/pageComponent/views/systemManager/authManager/roleManager/index.d.ts +0 -5
  60. package/dist/types/src/pageComponent/views/systemManager/authManager/roleManager/updateRoleDialog.d.ts +0 -34
  61. package/dist/types/src/pageComponent/views/systemManager/authManager/userManager/index.d.ts +0 -2
  62. package/dist/types/src/pageComponent/views/systemManager/authManager/userManager/updateUserDialog.d.ts +0 -36
  63. package/dist/types/src/pageComponent/views/systemManager/authManager/userManager/userProfileDialog.d.ts +0 -21
  64. package/dist/types/src/pageComponent/views/systemManager/logManager.d.ts +0 -2
  65. package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/depTree.d.ts +0 -10
  66. package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/employeeTable.d.ts +0 -19
  67. package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/index.d.ts +0 -2
  68. package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/updateDepDialog.d.ts +0 -42
  69. package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/updateEmployeeDialog.d.ts +0 -40
  70. package/dist/types/src/pageComponent/views/systemManager/orgManager/empManager.d.ts +0 -2
  71. package/dist/types/src/pageComponent/views/systemManager/orgManager/postManager/index.d.ts +0 -2
  72. package/dist/types/src/pageComponent/views/systemManager/orgManager/postManager/updatePostDialog.d.ts +0 -35
  73. package/dist/types/src/pageComponent/views/systemManager/orgManager/teamManager/index.d.ts +0 -2
  74. package/dist/types/src/pageComponent/views/systemManager/orgManager/teamManager/updateTeamDialog.d.ts +0 -35
  75. package/dist/types/src/pageComponent/views/systemManager/paramManager/collapseContainer.d.ts +0 -20
  76. package/dist/types/src/pageComponent/views/systemManager/paramManager/dynamicForm.d.ts +0 -11
  77. package/dist/types/src/pageComponent/views/systemManager/paramManager/index.d.ts +0 -2
  78. package/dist/types/src/pageComponent/views/systemManager/paramManager/tabItem.d.ts +0 -11
  79. package/dist/types/src/pageComponent/views/systemManager/personalSetting.d.ts +0 -2
  80. package/dist/types/src/utils/className.d.ts +0 -2
  81. package/dist/types/src/utils/config.d.ts +0 -4
  82. package/dist/types/src/utils/getSlots.d.ts +0 -3
  83. package/dist/types/src/utils/index.d.ts +0 -10
  84. package/dist/types/src/utils/installComponent.d.ts +0 -3
  85. package/src/components/index.ts +0 -1
  86. package/src/gl.d.ts +0 -19
  87. package/src/ht/ht-widget.d.ts +0 -11327
  88. package/src/ht/ht.d.ts +0 -11410
  89. package/src/ht/index.d.ts +0 -4
  90. package/src/index.ts +0 -17
  91. package/src/pageComponent/api/auth/menuManager.ts +0 -44
  92. package/src/pageComponent/api/auth/roleManager.ts +0 -50
  93. package/src/pageComponent/api/auth/userManager.ts +0 -76
  94. package/src/pageComponent/api/axios.ts +0 -79
  95. package/src/pageComponent/api/index.ts +0 -25
  96. package/src/pageComponent/api/logManager.ts +0 -18
  97. package/src/pageComponent/api/org/depManager.ts +0 -98
  98. package/src/pageComponent/api/org/postManager.ts +0 -53
  99. package/src/pageComponent/api/org/teamManager.ts +0 -67
  100. package/src/pageComponent/api/param.ts +0 -36
  101. package/src/pageComponent/assets/img/code.png +0 -0
  102. package/src/pageComponent/assets/img/loginBackground.png +0 -0
  103. package/src/pageComponent/assets/img/logo.png +0 -0
  104. package/src/pageComponent/assets/img/mtInfo.png +0 -0
  105. package/src/pageComponent/assets/img/mtLogoBig.png +0 -0
  106. package/src/pageComponent/assets/img.d.ts +0 -1
  107. package/src/pageComponent/assets/logo.png +0 -0
  108. package/src/pageComponent/assets/styles/const.less +0 -1
  109. package/src/pageComponent/assets/styles/constant/antd.less +0 -1
  110. package/src/pageComponent/assets/styles/index.less +0 -15
  111. package/src/pageComponent/assets/styles/login.less +0 -56
  112. package/src/pageComponent/assets/styles/loginBox.less +0 -51
  113. package/src/pageComponent/assets/styles/reset.less +0 -146
  114. package/src/pageComponent/assets/styles/systemManager/about.less +0 -56
  115. package/src/pageComponent/assets/styles/systemManager/index.less +0 -89
  116. package/src/pageComponent/assets/styles/systemManager/menu-manager.less +0 -52
  117. package/src/pageComponent/assets/styles/systemManager/param-manager.less +0 -44
  118. package/src/pageComponent/assets/zh-cn.js +0 -134
  119. package/src/pageComponent/components/CommonTree.tsx +0 -362
  120. package/src/pageComponent/components/DynamicIcon.tsx +0 -27
  121. package/src/pageComponent/components/EditPasswordForm.tsx +0 -89
  122. package/src/pageComponent/components/IconSelect.tsx +0 -51
  123. package/src/pageComponent/components/Navbar.tsx +0 -96
  124. package/src/pageComponent/components/ProFormItem.tsx +0 -185
  125. package/src/pageComponent/components/SearchSelect.tsx +0 -127
  126. package/src/pageComponent/components/Sidebar.tsx +0 -123
  127. package/src/pageComponent/components/loginBox/README.md +0 -21
  128. package/src/pageComponent/components/loginBox/index.tsx +0 -174
  129. package/src/pageComponent/config/global.ts +0 -20
  130. package/src/pageComponent/config/htconfig.ts +0 -32
  131. package/src/pageComponent/config/install.ts +0 -10
  132. package/src/pageComponent/hooks/global.ts +0 -12
  133. package/src/pageComponent/hooks/manage-module/useModalForm.ts +0 -37
  134. package/src/pageComponent/hooks/manage-module/useModalTitle.ts +0 -31
  135. package/src/pageComponent/hooks/manage-module/useModalVisibleControl.ts +0 -31
  136. package/src/pageComponent/hooks/useBus.ts +0 -26
  137. package/src/pageComponent/hooks/useProxy.ts +0 -8
  138. package/src/pageComponent/hooks/useTableList.ts +0 -57
  139. package/src/pageComponent/hooks/useVModel.ts +0 -16
  140. package/src/pageComponent/index.ts +0 -3
  141. package/src/pageComponent/utils/base64.ts +0 -27
  142. package/src/pageComponent/utils/index.ts +0 -19
  143. package/src/pageComponent/utils/is.ts +0 -30
  144. package/src/pageComponent/utils/transform.ts +0 -27
  145. package/src/pageComponent/utils/tree.ts +0 -59
  146. package/src/pageComponent/utils/validation.ts +0 -14
  147. package/src/pageComponent/views/alarms/index.tsx +0 -7
  148. package/src/pageComponent/views/index.tsx +0 -20
  149. package/src/pageComponent/views/login.tsx +0 -66
  150. package/src/pageComponent/views/systemManager/about.tsx +0 -127
  151. package/src/pageComponent/views/systemManager/authManager/menuManager/index.tsx +0 -42
  152. package/src/pageComponent/views/systemManager/authManager/menuManager/menuDetail.tsx +0 -174
  153. package/src/pageComponent/views/systemManager/authManager/menuManager/menuSelectTree.tsx +0 -111
  154. package/src/pageComponent/views/systemManager/authManager/menuManager/updateMenuDialog.tsx +0 -111
  155. package/src/pageComponent/views/systemManager/authManager/roleManager/index.tsx +0 -233
  156. package/src/pageComponent/views/systemManager/authManager/roleManager/updateRoleDialog.tsx +0 -207
  157. package/src/pageComponent/views/systemManager/authManager/userManager/index.tsx +0 -255
  158. package/src/pageComponent/views/systemManager/authManager/userManager/updateUserDialog.tsx +0 -294
  159. package/src/pageComponent/views/systemManager/authManager/userManager/userProfileDialog.tsx +0 -102
  160. package/src/pageComponent/views/systemManager/logManager.tsx +0 -356
  161. package/src/pageComponent/views/systemManager/orgManager/depManager/depTree.tsx +0 -101
  162. package/src/pageComponent/views/systemManager/orgManager/depManager/employeeTable.tsx +0 -204
  163. package/src/pageComponent/views/systemManager/orgManager/depManager/index.tsx +0 -112
  164. package/src/pageComponent/views/systemManager/orgManager/depManager/updateDepDialog.tsx +0 -249
  165. package/src/pageComponent/views/systemManager/orgManager/depManager/updateEmployeeDialog.tsx +0 -312
  166. package/src/pageComponent/views/systemManager/orgManager/empManager.tsx +0 -7
  167. package/src/pageComponent/views/systemManager/orgManager/postManager/index.tsx +0 -192
  168. package/src/pageComponent/views/systemManager/orgManager/postManager/updatePostDialog.tsx +0 -153
  169. package/src/pageComponent/views/systemManager/orgManager/teamManager/index.tsx +0 -191
  170. package/src/pageComponent/views/systemManager/orgManager/teamManager/updateTeamDialog.tsx +0 -250
  171. package/src/pageComponent/views/systemManager/paramManager/collapseContainer.tsx +0 -54
  172. package/src/pageComponent/views/systemManager/paramManager/dynamicForm.tsx +0 -85
  173. package/src/pageComponent/views/systemManager/paramManager/index.tsx +0 -47
  174. package/src/pageComponent/views/systemManager/paramManager/tabItem.tsx +0 -163
  175. package/src/pageComponent/views/systemManager/personalSetting.tsx +0 -206
  176. package/src/styles/index.less +0 -1
  177. package/src/utils/className.ts +0 -16
  178. package/src/utils/config.ts +0 -5
  179. package/src/utils/getSlots.ts +0 -18
  180. package/src/utils/index.ts +0 -7
  181. package/src/utils/installComponent.ts +0 -12
  182. package/tsconfig.json +0 -27
@@ -1,185 +0,0 @@
1
- /*
2
- * @Abstract: 动态表单项 根据api返回的描述 渲染不同的表单元素
3
- * @Author: wang liang
4
- * @Date: 2022-03-29 15:56:57
5
- * @LastEditors: wang liang
6
- * @LastEditTime: 2022-04-22 16:59:34
7
- */
8
-
9
- import {
10
- Ref,
11
- defineComponent,
12
- inject,
13
- computed,
14
- ref,
15
- watch,
16
- PropType,
17
- } from "vue";
18
- import { isObject } from "lodash";
19
-
20
- import {
21
- FormItem,
22
- Input,
23
- InputNumber,
24
- Switch,
25
- Select,
26
- SelectOption,
27
- } from "ant-design-vue";
28
-
29
- const ProFormItem = defineComponent({
30
- props: {
31
- description: {
32
- type: Object,
33
- required: true,
34
- },
35
- onChange: {
36
- type: Function as PropType<(name: string, value: any) => void>,
37
- required: true,
38
- },
39
- },
40
- setup(props) {
41
- // 参数描述
42
- const paramDefine = computed(() => props.description.paramDefine);
43
- // 参数值描述
44
- const paramDefineValue = computed(() => props.description.paramDefineValue);
45
- // 表单类型
46
- const type = computed(() => paramDefine.value.type);
47
- // 是否是开关表单
48
- const isSwitch = computed(() => type.value === "boolean");
49
-
50
- /* 是否修改状态 */
51
- const isEdit = inject<Ref<boolean>>("isEdit")!;
52
-
53
- /* ===== 输入框值 ===== */
54
- const inputValue = ref();
55
- watch(
56
- [() => props.description, isEdit],
57
- () => {
58
- // 传入的描述变化 / 切换为只读模式 => 恢复输入框的值
59
- const value = props.description.paramDefineValue.value;
60
- // boolean类型 true/false是字符串 所以需要单独判断
61
- inputValue.value = isSwitch.value
62
- ? value === "false"
63
- ? false
64
- : true
65
- : value;
66
- },
67
- { deep: true, immediate: true }
68
- );
69
- // 输入框变化回调
70
- const handleValueChange = (e: any) => {
71
- if (isObject(e)) {
72
- inputValue.value = (e as any).target.value;
73
- } else {
74
- inputValue.value = e;
75
- }
76
- // 通知父组件 值变化 父组件绑定到Form组件上(表单验证)
77
- props.onChange(props.description.paramDefine.code, inputValue.value);
78
- };
79
-
80
- /* ==== 根据类型 返回不同的表单项 ===== */
81
- let Filed: any = null;
82
- switch (type.value) {
83
- case "float":
84
- case "int":
85
- Filed = InputNumber;
86
- break;
87
- case "boolean":
88
- Filed = Switch;
89
- break;
90
- case "select":
91
- Filed = Select;
92
- break;
93
-
94
- default:
95
- Filed = Input;
96
- break;
97
- }
98
-
99
- // 动态表单规则
100
- const rules = computed(() => {
101
- const res: any[] = [];
102
- // 最大值
103
- if (paramDefine.value.maxValue !== null) {
104
- res.push({
105
- type: "number",
106
- max: paramDefine.value.maxValue,
107
- message: `最大值为${paramDefine.value.maxValue}`,
108
- });
109
- }
110
- // 最小值
111
- if (paramDefine.value.minValue !== null) {
112
- res.push({
113
- type: "number",
114
- min: paramDefine.value.minValue,
115
- message: `最小值为${paramDefine.value.minValue}`,
116
- });
117
- }
118
- // 最大长度
119
- if (paramDefine.value.limitLength !== null) {
120
- res.push({ max: paramDefine.value.limitLength });
121
- }
122
- // 正则
123
- if (paramDefine.value.regularExpression) {
124
- res.push({ pattern: new RegExp(paramDefine.value.regularExpression) });
125
- }
126
- // 是否必须
127
- if (paramDefine.value.required) {
128
- res.push({
129
- required: true,
130
- message: `${paramDefine.value.name}是必填项`,
131
- });
132
- }
133
- return res;
134
- });
135
-
136
- // 动态输入框prop
137
- const inputProps = computed(() => {
138
- const res: any = {};
139
-
140
- // 单位
141
- if (paramDefine.value.unit) {
142
- res["addon-after"] = paramDefine.value.unit;
143
- }
144
- // 是否可修改
145
- if (!paramDefine.value.writeable || !isEdit.value) {
146
- res.disabled = true;
147
- }
148
-
149
- /* 值绑定 开关需要绑定checked属性 */
150
- if (isSwitch.value) {
151
- res.checked = inputValue.value;
152
- } else {
153
- res.value = inputValue.value;
154
- }
155
-
156
- return res;
157
- });
158
-
159
- return () => {
160
- // console.log(isSwitch.value);
161
-
162
- const vModel = isSwitch.value
163
- ? [inputValue.value, "checked"]
164
- : [inputValue.value, "value"];
165
- return (
166
- <FormItem
167
- name={paramDefine.value.code}
168
- key={paramDefine.value.id}
169
- label={paramDefine.value.name}
170
- rules={rules.value}
171
- >
172
- <Filed
173
- style={{ width: isSwitch.value ? "" : "100%" }}
174
- {...inputProps.value}
175
- onChange={handleValueChange}
176
- >
177
- <SelectOption key="你好">你好</SelectOption>
178
- </Filed>
179
- </FormItem>
180
- );
181
- };
182
- },
183
- });
184
-
185
- export default ProFormItem;
@@ -1,127 +0,0 @@
1
- /*
2
- * @Abstract: 可以搜索的选择下拉框 对Select组件的二次封装
3
- * @Author: wang liang
4
- * @Date: 2022-04-19 16:46:58
5
- * @LastEditors: wang liang
6
- * @LastEditTime: 2022-04-24 13:58:53
7
- */
8
-
9
- import { PropType, defineComponent, ref, watch } from "vue";
10
- import useVModel from "@/pageComponent/hooks/useVModel";
11
- import { instance } from "@/pageComponent/api";
12
- import { isNil, debounce, isEqual } from "lodash";
13
- import { every } from "@/pageComponent/utils/is";
14
-
15
- import { Select, SelectOption } from "ant-design-vue";
16
- import { ArrowDownOutlined, ArrowUpOutlined } from "@ant-design/icons-vue";
17
-
18
- const SearchSelect = defineComponent({
19
- emits: ["update:value"],
20
- props: {
21
- value: {
22
- type: [String, Array, Number],
23
- },
24
- // 获取列表的url
25
- getUrl: {
26
- type: String,
27
- required: true,
28
- },
29
- /* 额外的参数 必须有值才能搜索 */
30
- extParams: {
31
- type: Object,
32
- },
33
- valuePorp: {
34
- type: Object as PropType<{ key: string; label: string }>,
35
- default: () => ({}),
36
- },
37
- /* 需要排除的值 不展示在下拉列表中 也无法选中 */
38
- excludeValues: {
39
- type: Array,
40
- default: () => [],
41
- },
42
- },
43
- setup(props, { emit, attrs }) {
44
- const modelValue = useVModel(props, "value", emit);
45
-
46
- /* 列表 */
47
- const optionList = ref([]);
48
- const isFetching = ref(false);
49
- let lastFetchId = 0;
50
- const getOptionList = debounce(async (val: string) => {
51
- if (
52
- !props.extParams ||
53
- every(props.extParams, (key, value) => !isNil(value))
54
- ) {
55
- const fetchId = lastFetchId;
56
- // 获取下拉列表
57
- optionList.value = [];
58
- isFetching.value = true;
59
- try {
60
- // 调用api传入参数
61
- const { data } = await instance.get(props.getUrl, {
62
- params: { ...props.extParams, keyword: val },
63
- });
64
- if (lastFetchId !== fetchId) {
65
- // for fetch callback order
66
- return;
67
- }
68
- optionList.value = data;
69
- } finally {
70
- isFetching.value = false;
71
- }
72
- }
73
- }, 300);
74
- getOptionList("");
75
-
76
- watch(
77
- () => props.extParams,
78
- (curr, prev) => {
79
- if (!isEqual(curr, prev)) {
80
- getOptionList("");
81
- }
82
- }
83
- );
84
-
85
- watch(
86
- () => props.excludeValues,
87
- (curr, prev) => {
88
- if (isEqual(curr, prev)) return;
89
- if (Array.isArray(modelValue.value)) {
90
- modelValue.value = modelValue.value.filter(
91
- (item) => !props.excludeValues.includes(item)
92
- );
93
- } else {
94
- if (props.excludeValues.includes(modelValue.value)) {
95
- modelValue.value = undefined;
96
- }
97
- }
98
- }
99
- );
100
-
101
- return () => (
102
- <Select
103
- {...attrs}
104
- notFoundContent={isFetching.value ? "加载中" : "暂无数据"}
105
- showSearch
106
- defaultActiveFirstOption={false}
107
- showArrow={true}
108
- filterOption={false}
109
- v-model={[modelValue.value, "value"]}
110
- onSearch={getOptionList}
111
- >
112
- {optionList.value.map(
113
- (item: any) =>
114
- !props.excludeValues.includes(
115
- item[props.valuePorp.key ?? "id"]
116
- ) && (
117
- <SelectOption key={item[props.valuePorp.key ?? "id"]}>
118
- {item[props.valuePorp.label ?? "name"]}
119
- </SelectOption>
120
- )
121
- )}
122
- </Select>
123
- );
124
- },
125
- });
126
-
127
- export default SearchSelect;
@@ -1,123 +0,0 @@
1
- import {
2
- defineComponent,
3
- reactive,
4
- ref,
5
- h,
6
- resolveComponent,
7
- watch,
8
- } from "vue";
9
- import { Menu, MenuItem, SubMenu } from "ant-design-vue";
10
- import { useRoute, useRouter } from "vue-router";
11
-
12
- // props
13
- const props = {
14
- menu: {
15
- type: Array,
16
- default: [],
17
- },
18
- path: {
19
- type: String,
20
- default: "",
21
- },
22
- };
23
-
24
- interface SOLT {
25
- icon?: Function;
26
- title: Function;
27
- }
28
-
29
- interface State {
30
- openKeys: Array<string>;
31
- selectedKeys: Array<string>;
32
- }
33
-
34
- export default defineComponent({
35
- components: { Menu, MenuItem, SubMenu },
36
- props,
37
- setup(prop, context) {
38
- const router = useRouter();
39
- const route = useRoute();
40
-
41
- const state: State = reactive({
42
- openKeys: [],
43
- selectedKeys: [],
44
- });
45
-
46
- watch(
47
- route,
48
- (nVal) => {
49
- const urlList = nVal.path.split("/");
50
- state.openKeys = [urlList[urlList.length - 2]];
51
- state.selectedKeys = [urlList[urlList.length - 1]];
52
- },
53
- { deep: true, immediate: true }
54
- );
55
-
56
- const toPath = (path: string) => {
57
- router.push({
58
- path: prop.path + path,
59
- });
60
- };
61
-
62
- const getSlots = (title: string, icon?: any) => {
63
- const obj: SOLT = {
64
- title: () => title,
65
- };
66
- if (icon) {
67
- obj.icon = () => h(resolveComponent(icon));
68
- }
69
-
70
- return obj;
71
- };
72
-
73
- const getMenuItem = (item: any, fPath?: string) => {
74
- const { meta } = item;
75
- let ele;
76
-
77
- if (meta.hide !== true) {
78
- ele = (
79
- <MenuItem
80
- key={item.path}
81
- onClick={() => toPath((fPath ? `${fPath}/` : "") + item.path)}
82
- v-slots={getSlots(meta.title, meta?.icon || "container-outlined")}
83
- >
84
- {meta.title}
85
- </MenuItem>
86
- );
87
- }
88
- return ele;
89
- };
90
-
91
- const getSubMenu = (obj: any, fPath?: string) => {
92
- return obj.map((item: any, index: string) => {
93
- const { meta } = item;
94
- let result;
95
-
96
- if (meta.hide !== true) {
97
- if (item?.children && item?.children.length > 0) {
98
- result = (
99
- <SubMenu key={item.path} v-slots={getSlots(meta.title)}>
100
- {getSubMenu(item.children, item.path)}
101
- </SubMenu>
102
- );
103
- } else {
104
- result = getMenuItem(item, fPath);
105
- }
106
- }
107
- return result;
108
- });
109
- };
110
-
111
- return () => (
112
- <Menu
113
- mode="inline"
114
- v-models={[
115
- [state.selectedKeys, "selectedKeys"],
116
- [state.openKeys, "openKeys"],
117
- ]}
118
- >
119
- {getSubMenu(prop.menu)}
120
- </Menu>
121
- );
122
- },
123
- });
@@ -1,21 +0,0 @@
1
- # 登录盒子
2
-
3
- > 为方便开发调试,特推出登录盒子模块
4
-
5
- ## 组件名称 [loginBox] 可根据引入进行自定义修改
6
-
7
- > 该组件依赖于 antv [form、input、message]
8
-
9
- ## 参数
10
-
11
- | 参数名称 | 类型 | 默认值 | 作用 |
12
- | -------- | ------- | ------ | -------------------------- |
13
- | password | String | | 设置默认密码 |
14
- | username | String | | 设置默认账号 |
15
- | autoMsg | Boolean | | 是否自动提示并拦截错误信息 |
16
-
17
- ## 方法
18
-
19
- | 方法名称 | 类型 | 返回参数 | 作用 |
20
- | -------- | -------- | -------------------------------- | ------------ |
21
- | onSubmit | Function | (e: EventBySubmitParams) => void | 用于提交表单 |
@@ -1,174 +0,0 @@
1
- import { defineComponent, reactive, ref, PropType } from "vue";
2
- import { Form, FormItem, Input, message } from "ant-design-vue";
3
- import { phoneNumber } from "@/pageComponent/utils/validation";
4
- import code from "@/pageComponent/assets/img/code.png";
5
-
6
- type LoginType = 1 | 2;
7
-
8
- // submit 参数
9
- export interface EventBySubmitParams {
10
- password: string;
11
- username: string;
12
- loginType: LoginType;
13
- msg?: string;
14
- }
15
- // loginTab 数据格式
16
- export type LoginTab<T = LoginType> = Array<{ name: string; id: T }>;
17
- // props
18
- const props = {
19
- loginTab: {
20
- type: Array as PropType<LoginTab>,
21
- default(): LoginTab {
22
- return [
23
- {
24
- name: "扫码登录",
25
- id: 1,
26
- },
27
- {
28
- name: "账号登录",
29
- id: 2,
30
- },
31
- ];
32
- },
33
- },
34
- password: {
35
- default: "",
36
- },
37
- username: {
38
- default: "",
39
- },
40
- autoMsg: Boolean,
41
- };
42
-
43
- export default defineComponent({
44
- props,
45
- emits: ["submit"],
46
- setup(prop, context) {
47
- const formRef = ref();
48
-
49
- const loginType = ref<LoginType>(2);
50
- const formVal = reactive({
51
- password: prop.password,
52
- username: prop.username,
53
- });
54
-
55
- const sendMsg = (msg: string, type: "error" | "success") => {
56
- if (!props.autoMsg) return;
57
-
58
- if (type === "error") {
59
- message.error(msg);
60
- }
61
- if (type === "success") {
62
- message.success(msg);
63
- }
64
- };
65
- const renderLoginTab = () => {
66
- return (
67
- <div class="login_tab">
68
- {prop.loginTab.map((item) => (
69
- <div
70
- class={["item", item.id === loginType.value ? "active" : ""]}
71
- onClick={() => {
72
- loginType.value = item.id as LoginType;
73
- }}
74
- >
75
- {item.name}
76
- </div>
77
- ))}
78
- </div>
79
- );
80
- };
81
-
82
- const handleSubmit = async () => {
83
- await formRef.value
84
- .validate(["username", "password"])
85
- .then()
86
- .catch((e: any) => {
87
- if (e.errorFields.length) {
88
- throw new Error();
89
- }
90
- });
91
-
92
- const data: EventBySubmitParams = {
93
- username: formVal.username,
94
- password: formVal.password,
95
- loginType: loginType.value,
96
- };
97
-
98
- // if (data.username === '' || !phoneNumber.test(data.username)) {
99
- // data.msg = '手机号错误';
100
- // }
101
-
102
- // if (!data.password || data.password.length <= 7) {
103
- // data.msg = `${data.msg} 密码输入错误`;
104
- // }
105
-
106
- if (data.msg) {
107
- sendMsg(data.msg, "error");
108
- }
109
- context.emit("submit", data);
110
- };
111
-
112
- const renderForm = () => {
113
- return (
114
- <Form
115
- ref={formRef}
116
- v-show={loginType.value === 2}
117
- onSubmit={handleSubmit}
118
- wrapper-col={{
119
- span: 24,
120
- }}
121
- model={formVal}
122
- >
123
- <FormItem
124
- name="username"
125
- wrapper-col={{ span: 50 }}
126
- rules={[{ required: true, message: "请输入用户名" }]}
127
- >
128
- <Input v-model={[formVal.username, "value"]}></Input>
129
- </FormItem>
130
- <FormItem
131
- name="password"
132
- rules={[
133
- { required: true, message: "请输入密码" },
134
- // { min: 8, max: 14, message: '密码长度在8-14个字符之间' },
135
- ]}
136
- >
137
- <Input
138
- type="password"
139
- v-model={[formVal.password, "value"]}
140
- ></Input>
141
- </FormItem>
142
-
143
- {/* <FormItem> */}
144
- <a-button type="primary" block html-type="submit">
145
- 登录
146
- </a-button>
147
- {/* </FormItem> */}
148
- </Form>
149
- );
150
- };
151
-
152
- const renderLoginCode = () => {
153
- return (
154
- <div
155
- v-show={loginType.value === 1}
156
- style={{ width: "100%", textAlign: "center" }}
157
- >
158
- <img src={code} alt="" style={{ width: "60%" }} />
159
- <p style={{ marginTop: "1rem" }}>请使用智信APP扫描二维码登录</p>
160
- </div>
161
- );
162
- };
163
-
164
- return () => (
165
- <div class="login_box">
166
- {renderLoginTab()}
167
- <h3>智信PC客户端</h3>
168
-
169
- {renderForm()}
170
- {renderLoginCode()}
171
- </div>
172
- );
173
- },
174
- });
@@ -1,20 +0,0 @@
1
- import { App } from 'vue';
2
- // import VConsole from 'vconsole';
3
- import vitevui from 'vitevui';
4
- import vitevuu from 'vitevuu';
5
- import * as Icons from '@ant-design/icons-vue';
6
- import router from '@/router';
7
- import 'vitevui/lib/style.css';
8
- import '@/assets/styles/index.less';
9
- import 'inl-ui/dist/antd.less';
10
- import 'dayjs/locale/zh-cn';
11
-
12
- export default (app: App): void => {
13
- app.config.globalProperties.$vitevuu = vitevuu;
14
- app.use(vitevui).use(router);
15
-
16
- for (const i in Icons) {
17
- app.component(i, Icons[i]);
18
- }
19
- // new VConsole();
20
- };
@@ -1,32 +0,0 @@
1
- window.htconfig = {
2
- Default: {
3
- toolTipDelay: 100,
4
- toolTipContinual: true,
5
- debugTipBackground: "rgba(61,61,61,0.6)",
6
- debugTipLabelColor: "#fff",
7
- convertURL: (url: string) => {
8
- const storagePrefix = "/ht_";
9
- if (
10
- storagePrefix &&
11
- url &&
12
- !/^data:image/.test(url) &&
13
- !/^http/.test(url) &&
14
- !/^https/.test(url)
15
- ) {
16
- url = `${storagePrefix}/${url}`;
17
- }
18
- // append timestamp
19
- url += `${url.indexOf("?") >= 0 ? "&" : "?"}ts=${Date.now()}`;
20
- // append sid
21
- const match = window.location.href.match("sid=([0-9a-z-]*)");
22
- if (match) {
23
- // eslint-disable-next-line prefer-destructuring
24
- window.sid = match[1];
25
- }
26
- if (window.sid) {
27
- url += `&sid=${window.sid}`;
28
- }
29
- return url;
30
- },
31
- },
32
- };
@@ -1,10 +0,0 @@
1
- import { createStore } from '@/_store';
2
-
3
- const state = {
4
- a: 6,
5
- };
6
-
7
- createStore({
8
- state,
9
- });
10
- export default createStore;
@@ -1,12 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
- /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
3
- import { getCurrentInstance } from "vue";
4
-
5
- export default () => {
6
- const { proxy } = getCurrentInstance()! as any;
7
- return {
8
- store: proxy!.$store,
9
- vitevuu: proxy!.$vitevuu,
10
- axios: proxy!.$axios,
11
- };
12
- };