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.
- package/.babelrc +3 -3
- package/README.md +28 -1
- package/dist/index.js +12707 -67
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/dark.less +204 -182
- package/dist/theme/default.less +109 -1067
- package/package.json +38 -36
- package/conf/config.output.ts +0 -0
- package/conf/cp.js +0 -51
- package/conf/rollup.config.ts +0 -36
- package/dist/theme/dark copy.less +0 -448
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/index.d.ts +0 -7
- package/dist/types/src/pageComponent/api/auth/menuManager.d.ts +0 -23
- package/dist/types/src/pageComponent/api/auth/roleManager.d.ts +0 -27
- package/dist/types/src/pageComponent/api/auth/userManager.d.ts +0 -45
- package/dist/types/src/pageComponent/api/axios.d.ts +0 -4
- package/dist/types/src/pageComponent/api/index.d.ts +0 -30
- package/dist/types/src/pageComponent/api/logManager.d.ts +0 -11
- package/dist/types/src/pageComponent/api/org/depManager.d.ts +0 -55
- package/dist/types/src/pageComponent/api/org/postManager.d.ts +0 -30
- package/dist/types/src/pageComponent/api/org/teamManager.d.ts +0 -38
- package/dist/types/src/pageComponent/api/param.d.ts +0 -32
- package/dist/types/src/pageComponent/components/CommonTree.d.ts +0 -57
- package/dist/types/src/pageComponent/components/DynamicIcon.d.ts +0 -13
- package/dist/types/src/pageComponent/components/EditPasswordForm.d.ts +0 -19
- package/dist/types/src/pageComponent/components/IconSelect.d.ts +0 -12
- package/dist/types/src/pageComponent/components/Navbar.d.ts +0 -13
- package/dist/types/src/pageComponent/components/ProFormItem.d.ts +0 -18
- package/dist/types/src/pageComponent/components/SearchSelect.d.ts +0 -49
- package/dist/types/src/pageComponent/components/Sidebar.d.ts +0 -20
- package/dist/types/src/pageComponent/components/loginBox/index.d.ts +0 -43
- package/dist/types/src/pageComponent/config/global.d.ts +0 -7
- package/dist/types/src/pageComponent/config/install.d.ts +0 -2
- package/dist/types/src/pageComponent/hooks/global.d.ts +0 -6
- package/dist/types/src/pageComponent/hooks/manage-module/useModalForm.d.ts +0 -5
- package/dist/types/src/pageComponent/hooks/manage-module/useModalTitle.d.ts +0 -6
- package/dist/types/src/pageComponent/hooks/manage-module/useModalVisibleControl.d.ts +0 -5
- package/dist/types/src/pageComponent/hooks/useBus.d.ts +0 -6
- package/dist/types/src/pageComponent/hooks/useProxy.d.ts +0 -4
- package/dist/types/src/pageComponent/hooks/useTableList.d.ts +0 -13
- package/dist/types/src/pageComponent/hooks/useVModel.d.ts +0 -1
- package/dist/types/src/pageComponent/index.d.ts +0 -2
- package/dist/types/src/pageComponent/utils/base64.d.ts +0 -14
- package/dist/types/src/pageComponent/utils/index.d.ts +0 -3
- package/dist/types/src/pageComponent/utils/is.d.ts +0 -10
- package/dist/types/src/pageComponent/utils/transform.d.ts +0 -10
- package/dist/types/src/pageComponent/utils/tree.d.ts +0 -16
- package/dist/types/src/pageComponent/utils/validation.d.ts +0 -11
- package/dist/types/src/pageComponent/views/alarms/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/login.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/about.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/index.d.ts +0 -5
- package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/menuDetail.d.ts +0 -10
- package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/menuSelectTree.d.ts +0 -18
- package/dist/types/src/pageComponent/views/systemManager/authManager/menuManager/updateMenuDialog.d.ts +0 -27
- package/dist/types/src/pageComponent/views/systemManager/authManager/roleManager/index.d.ts +0 -5
- package/dist/types/src/pageComponent/views/systemManager/authManager/roleManager/updateRoleDialog.d.ts +0 -34
- package/dist/types/src/pageComponent/views/systemManager/authManager/userManager/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/authManager/userManager/updateUserDialog.d.ts +0 -36
- package/dist/types/src/pageComponent/views/systemManager/authManager/userManager/userProfileDialog.d.ts +0 -21
- package/dist/types/src/pageComponent/views/systemManager/logManager.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/depTree.d.ts +0 -10
- package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/employeeTable.d.ts +0 -19
- package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/updateDepDialog.d.ts +0 -42
- package/dist/types/src/pageComponent/views/systemManager/orgManager/depManager/updateEmployeeDialog.d.ts +0 -40
- package/dist/types/src/pageComponent/views/systemManager/orgManager/empManager.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/orgManager/postManager/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/orgManager/postManager/updatePostDialog.d.ts +0 -35
- package/dist/types/src/pageComponent/views/systemManager/orgManager/teamManager/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/orgManager/teamManager/updateTeamDialog.d.ts +0 -35
- package/dist/types/src/pageComponent/views/systemManager/paramManager/collapseContainer.d.ts +0 -20
- package/dist/types/src/pageComponent/views/systemManager/paramManager/dynamicForm.d.ts +0 -11
- package/dist/types/src/pageComponent/views/systemManager/paramManager/index.d.ts +0 -2
- package/dist/types/src/pageComponent/views/systemManager/paramManager/tabItem.d.ts +0 -11
- package/dist/types/src/pageComponent/views/systemManager/personalSetting.d.ts +0 -2
- package/dist/types/src/utils/className.d.ts +0 -2
- package/dist/types/src/utils/config.d.ts +0 -4
- package/dist/types/src/utils/getSlots.d.ts +0 -3
- package/dist/types/src/utils/index.d.ts +0 -10
- package/dist/types/src/utils/installComponent.d.ts +0 -3
- package/src/components/index.ts +0 -1
- package/src/gl.d.ts +0 -19
- package/src/ht/ht-widget.d.ts +0 -11327
- package/src/ht/ht.d.ts +0 -11410
- package/src/ht/index.d.ts +0 -4
- package/src/index.ts +0 -17
- package/src/pageComponent/api/auth/menuManager.ts +0 -44
- package/src/pageComponent/api/auth/roleManager.ts +0 -50
- package/src/pageComponent/api/auth/userManager.ts +0 -76
- package/src/pageComponent/api/axios.ts +0 -79
- package/src/pageComponent/api/index.ts +0 -25
- package/src/pageComponent/api/logManager.ts +0 -18
- package/src/pageComponent/api/org/depManager.ts +0 -98
- package/src/pageComponent/api/org/postManager.ts +0 -53
- package/src/pageComponent/api/org/teamManager.ts +0 -67
- package/src/pageComponent/api/param.ts +0 -36
- package/src/pageComponent/assets/img/code.png +0 -0
- package/src/pageComponent/assets/img/loginBackground.png +0 -0
- package/src/pageComponent/assets/img/logo.png +0 -0
- package/src/pageComponent/assets/img/mtInfo.png +0 -0
- package/src/pageComponent/assets/img/mtLogoBig.png +0 -0
- package/src/pageComponent/assets/img.d.ts +0 -1
- package/src/pageComponent/assets/logo.png +0 -0
- package/src/pageComponent/assets/styles/const.less +0 -1
- package/src/pageComponent/assets/styles/constant/antd.less +0 -1
- package/src/pageComponent/assets/styles/index.less +0 -15
- package/src/pageComponent/assets/styles/login.less +0 -56
- package/src/pageComponent/assets/styles/loginBox.less +0 -51
- package/src/pageComponent/assets/styles/reset.less +0 -146
- package/src/pageComponent/assets/styles/systemManager/about.less +0 -56
- package/src/pageComponent/assets/styles/systemManager/index.less +0 -89
- package/src/pageComponent/assets/styles/systemManager/menu-manager.less +0 -52
- package/src/pageComponent/assets/styles/systemManager/param-manager.less +0 -44
- package/src/pageComponent/assets/zh-cn.js +0 -134
- package/src/pageComponent/components/CommonTree.tsx +0 -362
- package/src/pageComponent/components/DynamicIcon.tsx +0 -27
- package/src/pageComponent/components/EditPasswordForm.tsx +0 -89
- package/src/pageComponent/components/IconSelect.tsx +0 -51
- package/src/pageComponent/components/Navbar.tsx +0 -96
- package/src/pageComponent/components/ProFormItem.tsx +0 -185
- package/src/pageComponent/components/SearchSelect.tsx +0 -127
- package/src/pageComponent/components/Sidebar.tsx +0 -123
- package/src/pageComponent/components/loginBox/README.md +0 -21
- package/src/pageComponent/components/loginBox/index.tsx +0 -174
- package/src/pageComponent/config/global.ts +0 -20
- package/src/pageComponent/config/htconfig.ts +0 -32
- package/src/pageComponent/config/install.ts +0 -10
- package/src/pageComponent/hooks/global.ts +0 -12
- package/src/pageComponent/hooks/manage-module/useModalForm.ts +0 -37
- package/src/pageComponent/hooks/manage-module/useModalTitle.ts +0 -31
- package/src/pageComponent/hooks/manage-module/useModalVisibleControl.ts +0 -31
- package/src/pageComponent/hooks/useBus.ts +0 -26
- package/src/pageComponent/hooks/useProxy.ts +0 -8
- package/src/pageComponent/hooks/useTableList.ts +0 -57
- package/src/pageComponent/hooks/useVModel.ts +0 -16
- package/src/pageComponent/index.ts +0 -3
- package/src/pageComponent/utils/base64.ts +0 -27
- package/src/pageComponent/utils/index.ts +0 -19
- package/src/pageComponent/utils/is.ts +0 -30
- package/src/pageComponent/utils/transform.ts +0 -27
- package/src/pageComponent/utils/tree.ts +0 -59
- package/src/pageComponent/utils/validation.ts +0 -14
- package/src/pageComponent/views/alarms/index.tsx +0 -7
- package/src/pageComponent/views/index.tsx +0 -20
- package/src/pageComponent/views/login.tsx +0 -66
- package/src/pageComponent/views/systemManager/about.tsx +0 -127
- package/src/pageComponent/views/systemManager/authManager/menuManager/index.tsx +0 -42
- package/src/pageComponent/views/systemManager/authManager/menuManager/menuDetail.tsx +0 -174
- package/src/pageComponent/views/systemManager/authManager/menuManager/menuSelectTree.tsx +0 -111
- package/src/pageComponent/views/systemManager/authManager/menuManager/updateMenuDialog.tsx +0 -111
- package/src/pageComponent/views/systemManager/authManager/roleManager/index.tsx +0 -233
- package/src/pageComponent/views/systemManager/authManager/roleManager/updateRoleDialog.tsx +0 -207
- package/src/pageComponent/views/systemManager/authManager/userManager/index.tsx +0 -255
- package/src/pageComponent/views/systemManager/authManager/userManager/updateUserDialog.tsx +0 -294
- package/src/pageComponent/views/systemManager/authManager/userManager/userProfileDialog.tsx +0 -102
- package/src/pageComponent/views/systemManager/logManager.tsx +0 -356
- package/src/pageComponent/views/systemManager/orgManager/depManager/depTree.tsx +0 -101
- package/src/pageComponent/views/systemManager/orgManager/depManager/employeeTable.tsx +0 -204
- package/src/pageComponent/views/systemManager/orgManager/depManager/index.tsx +0 -112
- package/src/pageComponent/views/systemManager/orgManager/depManager/updateDepDialog.tsx +0 -249
- package/src/pageComponent/views/systemManager/orgManager/depManager/updateEmployeeDialog.tsx +0 -312
- package/src/pageComponent/views/systemManager/orgManager/empManager.tsx +0 -7
- package/src/pageComponent/views/systemManager/orgManager/postManager/index.tsx +0 -192
- package/src/pageComponent/views/systemManager/orgManager/postManager/updatePostDialog.tsx +0 -153
- package/src/pageComponent/views/systemManager/orgManager/teamManager/index.tsx +0 -191
- package/src/pageComponent/views/systemManager/orgManager/teamManager/updateTeamDialog.tsx +0 -250
- package/src/pageComponent/views/systemManager/paramManager/collapseContainer.tsx +0 -54
- package/src/pageComponent/views/systemManager/paramManager/dynamicForm.tsx +0 -85
- package/src/pageComponent/views/systemManager/paramManager/index.tsx +0 -47
- package/src/pageComponent/views/systemManager/paramManager/tabItem.tsx +0 -163
- package/src/pageComponent/views/systemManager/personalSetting.tsx +0 -206
- package/src/styles/index.less +0 -1
- package/src/utils/className.ts +0 -16
- package/src/utils/config.ts +0 -5
- package/src/utils/getSlots.ts +0 -18
- package/src/utils/index.ts +0 -7
- package/src/utils/installComponent.ts +0 -12
- package/tsconfig.json +0 -27
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { defineComponent, onMounted, reactive, ref } from "vue";
|
|
2
|
-
import useTableList from "@/pageComponent/hooks/useTableList";
|
|
3
|
-
import useModalVisibleControl from "@/pageComponent/hooks/manage-module/useModalVisibleControl";
|
|
4
|
-
import api from "@/pageComponent/api/org/postManager";
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
Table,
|
|
8
|
-
Input,
|
|
9
|
-
Button,
|
|
10
|
-
Switch,
|
|
11
|
-
Space,
|
|
12
|
-
message,
|
|
13
|
-
Modal,
|
|
14
|
-
} from "ant-design-vue";
|
|
15
|
-
import { SearchOutlined } from "@ant-design/icons-vue";
|
|
16
|
-
import UpdatePostDialog from "./updatePostDialog";
|
|
17
|
-
|
|
18
|
-
const column = [
|
|
19
|
-
{
|
|
20
|
-
title: "所属部门",
|
|
21
|
-
dataIndex: "depName",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
title: "岗位名称",
|
|
25
|
-
dataIndex: "name",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
title: "使用人数",
|
|
29
|
-
dataIndex: "employeeCount",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
title: "岗位描述",
|
|
33
|
-
dataIndex: "remark",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
title: "创建人",
|
|
37
|
-
dataIndex: "createUser",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
title: "创建时间",
|
|
41
|
-
dataIndex: "createDt",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
title: "启用状态",
|
|
45
|
-
key: "valid",
|
|
46
|
-
slots: { customRender: "valid" },
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
title: "操作",
|
|
50
|
-
key: "action",
|
|
51
|
-
slots: { customRender: "action" },
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
export default defineComponent({
|
|
56
|
-
setup(prop, context) {
|
|
57
|
-
const form = ref({
|
|
58
|
-
keyWord: "",
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
const { currPage, total, handlePageChange, isLoading, refresh, tableList } =
|
|
62
|
-
useTableList(
|
|
63
|
-
() =>
|
|
64
|
-
api.getPostList({
|
|
65
|
-
pageNum: currPage.value,
|
|
66
|
-
pageSize: 10,
|
|
67
|
-
keyword: form.value.keyWord,
|
|
68
|
-
}),
|
|
69
|
-
"jobPostList"
|
|
70
|
-
);
|
|
71
|
-
refresh();
|
|
72
|
-
|
|
73
|
-
/* 查看 */
|
|
74
|
-
const [isViewDialogShow, handleViewClick, viewRecord] =
|
|
75
|
-
useModalVisibleControl();
|
|
76
|
-
/* 新增 */
|
|
77
|
-
const [isAddDialogShow, handleAddClick] = useModalVisibleControl();
|
|
78
|
-
/* 编辑 */
|
|
79
|
-
const [isEditDialogShow, handleEditClick, editRecord] =
|
|
80
|
-
useModalVisibleControl();
|
|
81
|
-
/* 删除 */
|
|
82
|
-
const handleDeleteClick = (record: any) => {
|
|
83
|
-
if (record.employeeCount > 0) {
|
|
84
|
-
return message.warning("该岗位已引用,请删除引用才能删除或禁用");
|
|
85
|
-
}
|
|
86
|
-
Modal.confirm({
|
|
87
|
-
title: "删除岗位",
|
|
88
|
-
content: `是否删除岗位“${record.name}”?`,
|
|
89
|
-
async onOk() {
|
|
90
|
-
await api.deletePostById(record.id);
|
|
91
|
-
message.success("删除成功");
|
|
92
|
-
refresh();
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
/* 切换启用状态 */
|
|
98
|
-
const handleSwitchEnable = async (record: any, checked: boolean) => {
|
|
99
|
-
if (!checked && record.employeeCount > 0) {
|
|
100
|
-
return message.warning("该岗位已引用,请删除引用才能删除或禁用");
|
|
101
|
-
}
|
|
102
|
-
Modal.confirm({
|
|
103
|
-
title: "提示",
|
|
104
|
-
content: `确定${checked ? "启用" : "禁用"}吗`,
|
|
105
|
-
async onOk() {
|
|
106
|
-
await api.switchPostEnable({
|
|
107
|
-
id: record.id,
|
|
108
|
-
valid: checked ? 1 : 0,
|
|
109
|
-
});
|
|
110
|
-
message.success(`${checked ? "启用" : "禁用"}成功`);
|
|
111
|
-
refresh();
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
return () => (
|
|
117
|
-
<div class="postManager">
|
|
118
|
-
<div class="control">
|
|
119
|
-
<Space style={{ width: "100%", justifyContent: "space-between" }}>
|
|
120
|
-
<Button type="primary" onClick={handleAddClick}>
|
|
121
|
-
新建岗位
|
|
122
|
-
</Button>
|
|
123
|
-
<Input
|
|
124
|
-
placeholder="请输入"
|
|
125
|
-
allowClear
|
|
126
|
-
suffix={<SearchOutlined />}
|
|
127
|
-
v-model={[form.value.keyWord, "value"]}
|
|
128
|
-
onChange={refresh}
|
|
129
|
-
></Input>
|
|
130
|
-
</Space>
|
|
131
|
-
</div>
|
|
132
|
-
|
|
133
|
-
<Table
|
|
134
|
-
size="middle"
|
|
135
|
-
loading={isLoading.value}
|
|
136
|
-
dataSource={tableList.value}
|
|
137
|
-
columns={column}
|
|
138
|
-
pagination={{ total: total.value, onChange: handlePageChange }}
|
|
139
|
-
v-slots={{
|
|
140
|
-
valid: ({ record }: any) => {
|
|
141
|
-
return (
|
|
142
|
-
<Switch
|
|
143
|
-
checked={record.valid === 1}
|
|
144
|
-
onClick={
|
|
145
|
-
((checked: boolean, e: any) =>
|
|
146
|
-
handleSwitchEnable(record, checked)) as any
|
|
147
|
-
}
|
|
148
|
-
/>
|
|
149
|
-
);
|
|
150
|
-
},
|
|
151
|
-
action: ({ record }: any) => {
|
|
152
|
-
return (
|
|
153
|
-
<Space>
|
|
154
|
-
<Button type="link" onClick={() => handleViewClick(record)}>
|
|
155
|
-
查看
|
|
156
|
-
</Button>
|
|
157
|
-
<Button type="link" onClick={() => handleEditClick(record)}>
|
|
158
|
-
编辑
|
|
159
|
-
</Button>
|
|
160
|
-
<Button
|
|
161
|
-
type="link"
|
|
162
|
-
danger
|
|
163
|
-
onClick={() => handleDeleteClick(record)}
|
|
164
|
-
>
|
|
165
|
-
删除
|
|
166
|
-
</Button>
|
|
167
|
-
</Space>
|
|
168
|
-
);
|
|
169
|
-
},
|
|
170
|
-
}}
|
|
171
|
-
/>
|
|
172
|
-
|
|
173
|
-
<UpdatePostDialog
|
|
174
|
-
mode="view"
|
|
175
|
-
record={viewRecord.value}
|
|
176
|
-
v-model={[isViewDialogShow.value, "visible"]}
|
|
177
|
-
/>
|
|
178
|
-
<UpdatePostDialog
|
|
179
|
-
mode="add"
|
|
180
|
-
v-model={[isAddDialogShow.value, "visible"]}
|
|
181
|
-
onRefresh={refresh}
|
|
182
|
-
/>
|
|
183
|
-
<UpdatePostDialog
|
|
184
|
-
mode="edit"
|
|
185
|
-
record={editRecord.value}
|
|
186
|
-
v-model={[isEditDialogShow.value, "visible"]}
|
|
187
|
-
onRefresh={refresh}
|
|
188
|
-
/>
|
|
189
|
-
</div>
|
|
190
|
-
);
|
|
191
|
-
},
|
|
192
|
-
});
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Abstract: 新增、查看、编辑 岗位信息
|
|
3
|
-
* @Author: wang liang
|
|
4
|
-
* @Date: 2022-04-01 18:10:19
|
|
5
|
-
* @LastEditors: wang liang
|
|
6
|
-
* @LastEditTime: 2022-04-14 14:31:57
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { defineComponent, computed, ref, PropType } from "vue";
|
|
10
|
-
import useVModel from "@/pageComponent/hooks/useVModel";
|
|
11
|
-
import useModalTitle from "@/pageComponent/hooks/manage-module/useModalTitle";
|
|
12
|
-
import useModalForm from "@/pageComponent/hooks/manage-module/useModalForm";
|
|
13
|
-
import { getRequiredRule } from "@/pageComponent/utils/validation";
|
|
14
|
-
import api from "@/pageComponent/api/org/postManager";
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
Modal,
|
|
18
|
-
Form,
|
|
19
|
-
FormItem,
|
|
20
|
-
TreeSelect,
|
|
21
|
-
Input,
|
|
22
|
-
Textarea,
|
|
23
|
-
Space,
|
|
24
|
-
Button,
|
|
25
|
-
message,
|
|
26
|
-
} from "ant-design-vue";
|
|
27
|
-
|
|
28
|
-
const UpdatePostDialog = defineComponent({
|
|
29
|
-
emits: ["update:visible"],
|
|
30
|
-
props: {
|
|
31
|
-
visible: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: false,
|
|
34
|
-
},
|
|
35
|
-
mode: {
|
|
36
|
-
type: String as PropType<"view" | "add" | "edit">,
|
|
37
|
-
required: true,
|
|
38
|
-
},
|
|
39
|
-
record: {
|
|
40
|
-
type: Object,
|
|
41
|
-
default: () => ({}),
|
|
42
|
-
},
|
|
43
|
-
onRefresh: {
|
|
44
|
-
type: Function,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
setup(props, { emit }) {
|
|
48
|
-
const isVisible = useVModel(props, "visible", emit);
|
|
49
|
-
|
|
50
|
-
const modalTitle = useModalTitle(props.mode, "岗位");
|
|
51
|
-
|
|
52
|
-
const isView = computed(() => props.mode === "view");
|
|
53
|
-
|
|
54
|
-
/* ===== 部门列表 ===== */
|
|
55
|
-
const depList = ref([]);
|
|
56
|
-
const getDepList = async () => {
|
|
57
|
-
const list = await api.getDepList();
|
|
58
|
-
depList.value = list;
|
|
59
|
-
};
|
|
60
|
-
getDepList();
|
|
61
|
-
|
|
62
|
-
const { form, formRef } = useModalForm(
|
|
63
|
-
isVisible,
|
|
64
|
-
() => props.record,
|
|
65
|
-
props.mode
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
/* 保存 */
|
|
69
|
-
const handleSave = async () => {
|
|
70
|
-
await formRef.value.validate();
|
|
71
|
-
if (props.mode === "add") {
|
|
72
|
-
await api.insertPostRecord(form.value);
|
|
73
|
-
message.success("新增成功");
|
|
74
|
-
} else if (props.mode === "edit") {
|
|
75
|
-
await api.updatePostRecord({
|
|
76
|
-
...form.value,
|
|
77
|
-
createDt: null,
|
|
78
|
-
});
|
|
79
|
-
message.success("修改成功");
|
|
80
|
-
}
|
|
81
|
-
isVisible.value = false;
|
|
82
|
-
props.onRefresh?.();
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return () => (
|
|
86
|
-
<div class="update-post-dialog">
|
|
87
|
-
<Modal
|
|
88
|
-
title={modalTitle.value}
|
|
89
|
-
centered
|
|
90
|
-
v-model={[isVisible.value, "visible"]}
|
|
91
|
-
>
|
|
92
|
-
{{
|
|
93
|
-
default: () => (
|
|
94
|
-
<Form ref={formRef} labelCol={{ span: 4 }} model={form.value}>
|
|
95
|
-
<FormItem
|
|
96
|
-
name="depId"
|
|
97
|
-
required
|
|
98
|
-
label="所属部门"
|
|
99
|
-
rules={getRequiredRule("所属部门")}
|
|
100
|
-
>
|
|
101
|
-
{isView.value ? (
|
|
102
|
-
<span>{props.record.depName}</span>
|
|
103
|
-
) : (
|
|
104
|
-
<TreeSelect
|
|
105
|
-
fieldNames={{
|
|
106
|
-
label: "name",
|
|
107
|
-
value: "id",
|
|
108
|
-
children: "subList",
|
|
109
|
-
}}
|
|
110
|
-
treeData={depList.value}
|
|
111
|
-
v-model={[form.value.depId, "value"]}
|
|
112
|
-
></TreeSelect>
|
|
113
|
-
)}
|
|
114
|
-
</FormItem>
|
|
115
|
-
<FormItem
|
|
116
|
-
name="name"
|
|
117
|
-
required
|
|
118
|
-
label="岗位名称"
|
|
119
|
-
rules={getRequiredRule("岗位名称")}
|
|
120
|
-
>
|
|
121
|
-
{isView.value ? (
|
|
122
|
-
<span>{props.record.name}</span>
|
|
123
|
-
) : (
|
|
124
|
-
<Input v-model={[form.value.name, "value"]} />
|
|
125
|
-
)}
|
|
126
|
-
</FormItem>
|
|
127
|
-
<FormItem name="remark" label="岗位描述">
|
|
128
|
-
{isView.value ? (
|
|
129
|
-
<span>{props.record.remark}</span>
|
|
130
|
-
) : (
|
|
131
|
-
<Textarea v-model={[form.value.remark, "value"]} />
|
|
132
|
-
)}
|
|
133
|
-
</FormItem>
|
|
134
|
-
</Form>
|
|
135
|
-
),
|
|
136
|
-
footer: () => (
|
|
137
|
-
<Space>
|
|
138
|
-
<Button onClick={() => (isVisible.value = false)}>关闭</Button>
|
|
139
|
-
{!isView.value && (
|
|
140
|
-
<Button type="primary" onClick={handleSave}>
|
|
141
|
-
保存
|
|
142
|
-
</Button>
|
|
143
|
-
)}
|
|
144
|
-
</Space>
|
|
145
|
-
),
|
|
146
|
-
}}
|
|
147
|
-
</Modal>
|
|
148
|
-
</div>
|
|
149
|
-
);
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
export default UpdatePostDialog;
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref } from "vue";
|
|
2
|
-
import useTableList from "@/pageComponent/hooks/useTableList";
|
|
3
|
-
import useModalVisibleControl from "@/pageComponent/hooks/manage-module/useModalVisibleControl";
|
|
4
|
-
import api from "@/pageComponent/api/org/teamManager";
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
Table,
|
|
8
|
-
Input,
|
|
9
|
-
Button,
|
|
10
|
-
Switch,
|
|
11
|
-
Space,
|
|
12
|
-
message,
|
|
13
|
-
Modal,
|
|
14
|
-
} from "ant-design-vue";
|
|
15
|
-
import { SearchOutlined } from "@ant-design/icons-vue";
|
|
16
|
-
import UpdateTeamDialog from "./updateTeamDialog";
|
|
17
|
-
|
|
18
|
-
const column = [
|
|
19
|
-
{
|
|
20
|
-
title: "所属部门",
|
|
21
|
-
dataIndex: "depName",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
title: "岗位名称",
|
|
25
|
-
dataIndex: "jobPostName",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
title: "班组名称",
|
|
29
|
-
dataIndex: "name",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
title: "班组组长",
|
|
33
|
-
dataIndex: "leaderName",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
title: "班组成员",
|
|
37
|
-
dataIndex: "memberNames",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
title: "创建人",
|
|
41
|
-
dataIndex: "createUser",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
title: "创建时间",
|
|
45
|
-
dataIndex: "createDt",
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
title: "启动",
|
|
49
|
-
index: "valid",
|
|
50
|
-
slots: { customRender: "valid" },
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
title: "操作",
|
|
54
|
-
key: "action",
|
|
55
|
-
slots: { customRender: "action" },
|
|
56
|
-
},
|
|
57
|
-
];
|
|
58
|
-
|
|
59
|
-
export default defineComponent({
|
|
60
|
-
setup(prop, context) {
|
|
61
|
-
const form = ref({
|
|
62
|
-
keyWord: "",
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const { currPage, total, handlePageChange, isLoading, refresh, tableList } =
|
|
66
|
-
useTableList(
|
|
67
|
-
() =>
|
|
68
|
-
api.getTeamListByPage({
|
|
69
|
-
pageNum: currPage.value,
|
|
70
|
-
pageSize: 10,
|
|
71
|
-
keyword: form.value.keyWord,
|
|
72
|
-
}),
|
|
73
|
-
"workgroupList"
|
|
74
|
-
);
|
|
75
|
-
refresh();
|
|
76
|
-
|
|
77
|
-
/* 查看 */
|
|
78
|
-
const [isViewDialogShow, handleViewClick, viewRecord] =
|
|
79
|
-
useModalVisibleControl();
|
|
80
|
-
/* 新增 */
|
|
81
|
-
const [isAddDialogShow, handleAddClick] = useModalVisibleControl();
|
|
82
|
-
/* 编辑 */
|
|
83
|
-
const [isEditDialogShow, handleEditClick, editRecord] =
|
|
84
|
-
useModalVisibleControl();
|
|
85
|
-
|
|
86
|
-
/* 删除 */
|
|
87
|
-
const handleDeleteClick = (record: any) => {
|
|
88
|
-
Modal.confirm({
|
|
89
|
-
title: "删除班组",
|
|
90
|
-
content: `确定删除班组“${record.name}”?`,
|
|
91
|
-
async onOk() {
|
|
92
|
-
await api.deleteTeamById(record.id);
|
|
93
|
-
message.success("删除成功");
|
|
94
|
-
refresh();
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/* 切换启用状态 */
|
|
100
|
-
const handleSwitchEnable = async (record: any, checked: boolean) => {
|
|
101
|
-
Modal.confirm({
|
|
102
|
-
title: "提示",
|
|
103
|
-
content: `确定${checked ? "启用" : "禁用"}吗`,
|
|
104
|
-
async onOk() {
|
|
105
|
-
await api.switchEnableTeam({
|
|
106
|
-
id: record.id,
|
|
107
|
-
valid: checked ? 1 : 0,
|
|
108
|
-
});
|
|
109
|
-
message.success(`${checked ? "启用" : "禁用"}成功`);
|
|
110
|
-
refresh();
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
return () => (
|
|
116
|
-
<div class="postManager">
|
|
117
|
-
<div class="control">
|
|
118
|
-
<Space style={{ width: "100%", justifyContent: "space-between" }}>
|
|
119
|
-
<Button type="primary" onClick={handleAddClick}>
|
|
120
|
-
新建班组
|
|
121
|
-
</Button>
|
|
122
|
-
<Input
|
|
123
|
-
placeholder="请输入"
|
|
124
|
-
allowClear
|
|
125
|
-
suffix={<SearchOutlined />}
|
|
126
|
-
v-model={[form.value.keyWord, "value"]}
|
|
127
|
-
onChange={refresh}
|
|
128
|
-
></Input>
|
|
129
|
-
</Space>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
<Table
|
|
133
|
-
size="middle"
|
|
134
|
-
loading={isLoading.value}
|
|
135
|
-
dataSource={tableList.value}
|
|
136
|
-
columns={column}
|
|
137
|
-
pagination={{ total: total.value, onChange: handlePageChange }}
|
|
138
|
-
v-slots={{
|
|
139
|
-
valid: ({ record }: any) => {
|
|
140
|
-
return (
|
|
141
|
-
<Switch
|
|
142
|
-
checked={record.valid === 1}
|
|
143
|
-
onClick={
|
|
144
|
-
((checked: boolean, e: any) =>
|
|
145
|
-
handleSwitchEnable(record, checked)) as any
|
|
146
|
-
}
|
|
147
|
-
/>
|
|
148
|
-
);
|
|
149
|
-
},
|
|
150
|
-
action: ({ record }: any) => {
|
|
151
|
-
return (
|
|
152
|
-
<Space>
|
|
153
|
-
<Button type="link" onClick={() => handleViewClick(record)}>
|
|
154
|
-
查看
|
|
155
|
-
</Button>
|
|
156
|
-
<Button type="link" onClick={() => handleEditClick(record)}>
|
|
157
|
-
编辑
|
|
158
|
-
</Button>
|
|
159
|
-
<Button
|
|
160
|
-
type="link"
|
|
161
|
-
danger
|
|
162
|
-
onClick={() => handleDeleteClick(record)}
|
|
163
|
-
>
|
|
164
|
-
删除
|
|
165
|
-
</Button>
|
|
166
|
-
</Space>
|
|
167
|
-
);
|
|
168
|
-
},
|
|
169
|
-
}}
|
|
170
|
-
/>
|
|
171
|
-
|
|
172
|
-
<UpdateTeamDialog
|
|
173
|
-
mode="view"
|
|
174
|
-
record={viewRecord.value}
|
|
175
|
-
v-model={[isViewDialogShow.value, "visible"]}
|
|
176
|
-
/>
|
|
177
|
-
<UpdateTeamDialog
|
|
178
|
-
mode="add"
|
|
179
|
-
v-model={[isAddDialogShow.value, "visible"]}
|
|
180
|
-
onRefresh={refresh}
|
|
181
|
-
/>
|
|
182
|
-
<UpdateTeamDialog
|
|
183
|
-
mode="edit"
|
|
184
|
-
record={editRecord.value}
|
|
185
|
-
v-model={[isEditDialogShow.value, "visible"]}
|
|
186
|
-
onRefresh={refresh}
|
|
187
|
-
/>
|
|
188
|
-
</div>
|
|
189
|
-
);
|
|
190
|
-
},
|
|
191
|
-
});
|