egova-urbanpro-web 0.0.1
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/README.md +134 -0
- package/es/_plugin-vue_export-helper-BwmSBgGG.js +9 -0
- package/es/act-menu-refresh-3YeQne1X.js +77 -0
- package/es/async-select-modal-lRKCEMBM.js +316 -0
- package/es/bulletin-add-Dt1Xi_oL.js +1251 -0
- package/es/bulletin-config-Ber1L1T2.js +297 -0
- package/es/bulletin-detail-Ce7riX6X.js +1430 -0
- package/es/bulletin-detail-file-2Ij39UlM.js +187 -0
- package/es/bulletin-drawer-DmwW23ng.js +461 -0
- package/es/bulletin-level-Cz_6Mg2x.js +501 -0
- package/es/bulletin-manage-JMjvzUhg.js +1526 -0
- package/es/bulletin-notify-info-drawer-vR3KSaRS.js +487 -0
- package/es/bulletin-property-CvohCK8q.js +656 -0
- package/es/bulletin-type-CQS6_MYv.js +675 -0
- package/es/bulletin-view-DcdZrV19.js +870 -0
- package/es/business-collection-and-repair-B2DfBAsx.js +109 -0
- package/es/cascader-filter-DOg-iNnE.js +68 -0
- package/es/cascader-multiple-filter-C-cKxmkk.js +103 -0
- package/es/chat-BB8_LIT6.js +4634 -0
- package/es/checkbox-filter-DC1VaGo9.js +39 -0
- package/es/chunk-CHb_fpD5.js +29 -0
- package/es/condition-search-criteria-B_HnHQBy.js +190 -0
- package/es/constant-CYnp-Cj8.js +4925 -0
- package/es/constants-BijBPSuc.js +480 -0
- package/es/constants-DQ6XzzDS.js +137 -0
- package/es/contact-DxLrJ_f_.js +339 -0
- package/es/contact-unit-BvCPmyNK.js +708 -0
- package/es/department-radio-filter-BbrntEcc.js +72 -0
- package/es/downtime-timer-repair-D_SuN4fE.js +255 -0
- package/es/dynamic-form-input-10ce5824-Cju2XHEl.js +60 -0
- package/es/dynamic-form-input-number-c60b4ff5-gYvoAgss.js +61 -0
- package/es/dynamic-form-login-type-6c9d78bf-CxtLGfA6.js +175 -0
- package/es/dynamic-form-multiple-select-3e2bd885-CrD_ALk8.js +77 -0
- package/es/dynamic-form-password-57dc81c4-CcmoNfq0.js +84 -0
- package/es/dynamic-form-region-tree-b2c57d1c-BRm2M8Er.js +133 -0
- package/es/dynamic-form-select-cdbf49ad-C0eLS2zd.js +76 -0
- package/es/dynamic-form-upload-768a0d32-ClHw2ZkO.js +116 -0
- package/es/egova-urbanpro-web.css +10907 -0
- package/es/egova-urbanpro-web.d.ts +79 -0
- package/es/egova-urbanpro-web.js +9223 -0
- package/es/field-cell-PNcIBk8w.js +93 -0
- package/es/field-icon-cell-BQvkUM-O.js +65 -0
- package/es/file-cell-ClyA9XoC.js +147 -0
- package/es/hooks-CuXq9j8q.js +324 -0
- package/es/icon-cell-BF-Nf-QP.js +78 -0
- package/es/im-conversation-06-TFmZZ.js +158 -0
- package/es/image-cell-cu9ezfsV.js +92 -0
- package/es/image-gray-surS1IZ2.js +5 -0
- package/es/index-15d85366-BVTMMFAV.js +97 -0
- package/es/index-lib-23bd328c-DtcJvHvJ.js +42122 -0
- package/es/info-card-DgYedeWN.js +30 -0
- package/es/localforage-B_66fZyP.js +1798 -0
- package/es/number-filter-SyfJaaIG.js +55 -0
- package/es/operation-selector-TEcr5s2w.js +157 -0
- package/es/option-style-BTFl4VQj.js +32 -0
- package/es/package.json +46 -0
- package/es/query-CiRQQsE1.js +11 -0
- package/es/radio-filter-t5QSYiRY.js +68 -0
- package/es/rec-delete-DBvqRiKp.js +74 -0
- package/es/rec-timer-refresh-Dfd6hH2t.js +74 -0
- package/es/region-radio-filter-CoybNPaj.js +271 -0
- package/es/render-cell-BI9mUiTe.js +45 -0
- package/es/select-checkbox-filter-B89vKdLG.js +60 -0
- package/es/select-multiple-tree-filter-BEYUKg7q.js +298 -0
- package/es/select-radio-filter-BW2P3uwp.js +58 -0
- package/es/select-single-tree-filter-CKYo3kV1.js +94 -0
- package/es/service-BabEdPB2.js +100 -0
- package/es/service-fs3hJh7w.js +126 -0
- package/es/text-filter-B80UB8KG.js +66 -0
- package/es/time-filter-Nc-cflut.js +211 -0
- package/es/types-DjDPFQk1.js +44 -0
- package/es/use-file-D_9JbApO.js +58 -0
- package/es/user-radio-filter-T79Kp2jW.js +72 -0
- package/es/utils-4fqWDxwG.js +2643 -0
- package/es/utils-BlJtAQle.js +161 -0
- package/es/utils-Cn_7yZzr.js +355 -0
- package/es/utils-D-E5UJPP.js +14 -0
- package/es/version.json +33 -0
- package/package.json +165 -0
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# egova-urbanpro-web
|
|
2
|
+
|
|
3
|
+
前端框架技术路线
|
|
4
|
+
|
|
5
|
+
[Vite](https://vitejs.dev/) + [Vue3](https://vuejs.org/) + [TypeScript](https://www.typescriptlang.org/) + [Ant Design Vue](https://antdv.com/) + [ZartUI-Web](https://web.zartui.egova.com.cn/)
|
|
6
|
+
|
|
7
|
+
包管理工具
|
|
8
|
+
|
|
9
|
+
[pnpm](https://pnpm.io/)
|
|
10
|
+
|
|
11
|
+
## 1 安装
|
|
12
|
+
|
|
13
|
+
### 1.1 脚手架
|
|
14
|
+
|
|
15
|
+
#### 1.1.1 安装脚手架
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
pnpm add -g egova-urbanpro-cli
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
#### 1.1.2 创建项目
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
# egova-urbanpro-cli create [options] [template]
|
|
25
|
+
egova-urbanpro-cli create
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### 1.1.3 创建组件
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
# egova-urbanpro-cli [options] component <name> [folder]
|
|
32
|
+
egova-urbanpro-cli component component-name src/components
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
> 注:`[folder]` 可省略,默认为 `src/components`,创建的组件将自动以字母 `C` 开头
|
|
36
|
+
>
|
|
37
|
+
> - `components` 内组件应该以字母 `C` 开头,意为组件
|
|
38
|
+
> - `views` 内组件应该以字母 `V` 开头,意为页面
|
|
39
|
+
|
|
40
|
+
#### 1.1.4 安装项目依赖
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
pnpm install
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 1.2 IDE 支持
|
|
47
|
+
|
|
48
|
+
推荐使用 [Visual Studio Code](https://code.visualstudio.com/)
|
|
49
|
+
|
|
50
|
+
#### 1.2.1 VSCode 插件
|
|
51
|
+
|
|
52
|
+
- [Vue Language Features (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
|
|
53
|
+
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
|
54
|
+
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
|
55
|
+
- [Stylelint](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)
|
|
56
|
+
|
|
57
|
+
### 1.3 项目结构
|
|
58
|
+
|
|
59
|
+
根据代码仓库规范与业务划分原则,将核心平台仓库拆分为 web、core、extend、projects 仓库,业务代码仓库按同样规则拆分,项目结构如下:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
egova-urbanpro
|
|
63
|
+
├── egova-urbanpro-platform # 核心平台
|
|
64
|
+
│ ├── egova-urbanpro-core # 核心平台 core
|
|
65
|
+
│ ├── egova-urbanpro-extend # 核心平台 extend
|
|
66
|
+
│ └── egova-urbanpro-web # 核心平台 web
|
|
67
|
+
├── egova-urbanpro-mis # MIS 业务
|
|
68
|
+
│ ├── egova-urbanpro-mis-core
|
|
69
|
+
│ ├── egova-urbanpro-mis-extend
|
|
70
|
+
│ └── egova-urbanpro-mis-projects
|
|
71
|
+
└── zartui-web # ZartUI
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## 2 命令
|
|
75
|
+
|
|
76
|
+
### 2.1 开发
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
pnpm dev
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 2.2 打包
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
pnpm build
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 2.3 打包预览
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
pnpm preview
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 2.4 打包文件分析统计
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
pnpm analyse
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 2.5 Lint with [ESLint](https://eslint.org/) & [Stylelint](https://stylelint.io/)
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
# 检查修复
|
|
104
|
+
pnpm lint
|
|
105
|
+
|
|
106
|
+
# 仅检查 es
|
|
107
|
+
pnpm lint:es
|
|
108
|
+
|
|
109
|
+
# 仅检查 style
|
|
110
|
+
pnpm lint:style
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## 3 开发说明
|
|
114
|
+
|
|
115
|
+
### 3.1 环境变量
|
|
116
|
+
|
|
117
|
+
系统环境变量定义在 `.env.development` 中:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
########## 代理配置 ##########
|
|
121
|
+
# 主代理
|
|
122
|
+
PROXY_PATH_API=http://localhost:8080
|
|
123
|
+
|
|
124
|
+
# GIS 代理
|
|
125
|
+
PROXY_PATH_API_GIS=http://localhost:8080
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
开发时,不建议修改 `.env.development` 文件,应该新建 `.env.development.local` 文件定义本地变量。此文件会被 git 忽略,不会提交。
|
|
129
|
+
|
|
130
|
+
参考文档 [环境变量和模式](https://cn.vitejs.dev/guide/env-and-mode.html#env-files)
|
|
131
|
+
|
|
132
|
+
### 3.2 开发文档
|
|
133
|
+
|
|
134
|
+
[系统开发说明](https://alidocs.dingtalk.com/i/nodes/ZK0RbznqyYaWdywzbaDXV953mBE4AdDw)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*! egova-urbanpro-web v0.0.1 */
|
|
2
|
+
//#region \0plugin-vue:export-helper
|
|
3
|
+
var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
4
|
+
const target = sfc.__vccOpts || sfc;
|
|
5
|
+
for (const [key, val] of props) target[key] = val;
|
|
6
|
+
return target;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { _plugin_vue_export_helper_default as t };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*! egova-urbanpro-web v0.0.1 */
|
|
2
|
+
import { j as http } from "./utils-4fqWDxwG.js";
|
|
3
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BwmSBgGG.js";
|
|
4
|
+
import "./types-DjDPFQk1.js";
|
|
5
|
+
import "./service-BabEdPB2.js";
|
|
6
|
+
import "./condition-search-criteria-B_HnHQBy.js";
|
|
7
|
+
import { n as maintenanceService, r as linglong_page_default, t as TEMPLATE_CODE } from "./constant-CYnp-Cj8.js";
|
|
8
|
+
import { createBlock, createElementVNode, createVNode, defineComponent, onBeforeMount, openBlock, ref, resolveComponent, withCtx } from "vue";
|
|
9
|
+
import { Modal } from "ant-design-vue";
|
|
10
|
+
import { ZtPanelBackground } from "zartd-biz/es/index";
|
|
11
|
+
import { useRoute } from "vue-router";
|
|
12
|
+
//#region ../egova-urbanpro-extend/src/views/maintenance/act-menu-refresh/index.ts?vue&type=script&src=true&lang.ts
|
|
13
|
+
var index_ts_vue_type_script_src_true_lang_default = defineComponent({
|
|
14
|
+
name: "CActMenuRefresh",
|
|
15
|
+
components: { CLinglongPage: linglong_page_default },
|
|
16
|
+
setup() {
|
|
17
|
+
const service = new maintenanceService(http);
|
|
18
|
+
const route = useRoute();
|
|
19
|
+
const linglongPageRef = ref(null);
|
|
20
|
+
const pageData = ref({
|
|
21
|
+
title: "活动菜单刷新",
|
|
22
|
+
pageId: "",
|
|
23
|
+
operateBtns: [{
|
|
24
|
+
name: "刷新菜单",
|
|
25
|
+
icon: "zt-iconfont zt-icon-refresh",
|
|
26
|
+
needCheck: true,
|
|
27
|
+
btnClick: () => onRefresh()
|
|
28
|
+
}]
|
|
29
|
+
});
|
|
30
|
+
async function onRefresh() {
|
|
31
|
+
Modal.confirm({
|
|
32
|
+
title: "提示",
|
|
33
|
+
content: "确认刷新所选数据活动菜单?",
|
|
34
|
+
async onOk() {
|
|
35
|
+
const pageComp = linglongPageRef.value;
|
|
36
|
+
const bizEntryUids = pageComp?.checkedList?.map((item) => item.rec_id?.value) || [];
|
|
37
|
+
try {
|
|
38
|
+
await service.batchRefreshActMenu({
|
|
39
|
+
bizEntryUids,
|
|
40
|
+
refreshDb: true
|
|
41
|
+
});
|
|
42
|
+
pageComp?.refresh?.();
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.log("error: ", error);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
onBeforeMount(async () => {
|
|
50
|
+
const templateCode = route.query.templateCode || TEMPLATE_CODE.ACT_MENU_REFRESH_LIST;
|
|
51
|
+
const res = await service.getDetailByCode({ templateCode });
|
|
52
|
+
if (!res.hasError && res.result?.data) pageData.value.pageId = res.result.data?.partId;
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
pageData,
|
|
56
|
+
linglongPageRef
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region ../egova-urbanpro-extend/src/views/maintenance/act-menu-refresh/index.vue
|
|
62
|
+
var _hoisted_1 = { class: "c-act-menu-refresh" };
|
|
63
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
64
|
+
const _component_c_linglong_page = resolveComponent("c-linglong-page");
|
|
65
|
+
const _component_zt_panel_background = ZtPanelBackground;
|
|
66
|
+
return openBlock(), createBlock(_component_zt_panel_background, { style: { "padding": "0.2rem !important" } }, {
|
|
67
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(_component_c_linglong_page, {
|
|
68
|
+
ref: "linglongPageRef",
|
|
69
|
+
"page-id": _ctx.pageData.pageId,
|
|
70
|
+
"operate-btns": _ctx.pageData.operateBtns
|
|
71
|
+
}, null, 8, ["page-id", "operate-btns"])])]),
|
|
72
|
+
_: 1
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
var act_menu_refresh_default = /* @__PURE__ */ _plugin_vue_export_helper_default(index_ts_vue_type_script_src_true_lang_default, [["render", _sfc_render], ["__scopeId", "data-v-7e3fffed"]]);
|
|
76
|
+
//#endregion
|
|
77
|
+
export { act_menu_refresh_default as default };
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/*! egova-urbanpro-web v0.0.1 */
|
|
2
|
+
import { N as linglongHttp } from "./utils-4fqWDxwG.js";
|
|
3
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BwmSBgGG.js";
|
|
4
|
+
import { n as TenantIdKey } from "./query-CiRQQsE1.js";
|
|
5
|
+
import { r as ModalType } from "./types-DjDPFQk1.js";
|
|
6
|
+
import { t as Service } from "./service-BabEdPB2.js";
|
|
7
|
+
import { isNil } from "lodash-es";
|
|
8
|
+
import { useElementRef } from "@kyjian/libs/hooks";
|
|
9
|
+
import { handleTreeData, isEmptyText } from "@kyjian/libs/utils";
|
|
10
|
+
import { Fragment, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, openBlock, popScopeId, pushScopeId, reactive, ref, renderList, toDisplayString, watch, withCtx } from "vue";
|
|
11
|
+
import { Modal } from "ant-design-vue/es";
|
|
12
|
+
import { ZtEmpty, ZtTextSearch, ZtTreeSearch } from "zartd-biz/es/index";
|
|
13
|
+
import { useDebounceFn } from "@vueuse/core";
|
|
14
|
+
//#region ../egova-urbanpro-core/src/components/linglong/condition-panel/components/async-select-modal/index.ts?vue&type=script&src=true&lang.ts
|
|
15
|
+
var index_ts_vue_type_script_src_true_lang_default = defineComponent({
|
|
16
|
+
name: "CAsyncSelectModal",
|
|
17
|
+
props: {
|
|
18
|
+
visible: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
title: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "人员"
|
|
25
|
+
},
|
|
26
|
+
type: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "user"
|
|
29
|
+
},
|
|
30
|
+
value: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ["update:visible", "ok"],
|
|
36
|
+
setup(props, { emit }) {
|
|
37
|
+
const service = new Service(linglongHttp);
|
|
38
|
+
const { element: modelRef } = useElementRef();
|
|
39
|
+
const treeData = ref([]);
|
|
40
|
+
const checkedKeys = ref([]);
|
|
41
|
+
const expandedKeys = ref([]);
|
|
42
|
+
const loadedKeys = ref([]);
|
|
43
|
+
const selectedData = ref([]);
|
|
44
|
+
const preSelectedData = ref([]);
|
|
45
|
+
const fieldNames = {
|
|
46
|
+
key: "id",
|
|
47
|
+
title: "name",
|
|
48
|
+
children: "children"
|
|
49
|
+
};
|
|
50
|
+
const init = ref(true);
|
|
51
|
+
const searchValue = ref("");
|
|
52
|
+
const tenantId = inject(TenantIdKey);
|
|
53
|
+
const allNodes = reactive(/* @__PURE__ */ new Map());
|
|
54
|
+
const handleCancel = () => {
|
|
55
|
+
emit("update:visible", false);
|
|
56
|
+
selectedData.value = [...preSelectedData.value];
|
|
57
|
+
};
|
|
58
|
+
const handleOk = async () => {
|
|
59
|
+
emit("ok", selectedData.value);
|
|
60
|
+
emit("update:visible", false);
|
|
61
|
+
preSelectedData.value = [...selectedData.value];
|
|
62
|
+
};
|
|
63
|
+
const handleDelete = (id) => {
|
|
64
|
+
checkedKeys.value = checkedKeys.value.filter((item) => item !== id);
|
|
65
|
+
};
|
|
66
|
+
function handleAllDelete() {
|
|
67
|
+
checkedKeys.value = [];
|
|
68
|
+
}
|
|
69
|
+
function onLoadData(node) {
|
|
70
|
+
const id = node?.id;
|
|
71
|
+
return new Promise(async (resolve) => {
|
|
72
|
+
if (!id || !tenantId?.value) return resolve(true);
|
|
73
|
+
let res;
|
|
74
|
+
try {
|
|
75
|
+
switch (props.type) {
|
|
76
|
+
case ModalType.DEPARTMENT:
|
|
77
|
+
res = await service.getDepartmentTreeData(tenantId?.value, id);
|
|
78
|
+
break;
|
|
79
|
+
case ModalType.USER:
|
|
80
|
+
res = await service.getUserTreeData(tenantId?.value, id);
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
if (res && !res.hasError && res.result?.length) {
|
|
84
|
+
node.dataRef.children = handleTreeData({
|
|
85
|
+
treeNodes: res.result[0].children || [],
|
|
86
|
+
allNodes,
|
|
87
|
+
handleNodeData: (node) => ({
|
|
88
|
+
isLeaf: node?.attributes?.childrenCount === "0" || node.type === "user",
|
|
89
|
+
title: node.name
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
treeData.value = [...treeData.value];
|
|
93
|
+
}
|
|
94
|
+
loadedKeys.value.push(id);
|
|
95
|
+
resolve(true);
|
|
96
|
+
} catch (e) {
|
|
97
|
+
console.log(e);
|
|
98
|
+
resolve(false);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
async function getUserData() {
|
|
103
|
+
if (!tenantId?.value) return;
|
|
104
|
+
let res;
|
|
105
|
+
try {
|
|
106
|
+
switch (props.type) {
|
|
107
|
+
case ModalType.DEPARTMENT:
|
|
108
|
+
res = await service.getDepartmentTreeData(tenantId?.value);
|
|
109
|
+
break;
|
|
110
|
+
default:
|
|
111
|
+
res = await service.getUserTreeData(tenantId?.value);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
if (res && !res.hasError) {
|
|
115
|
+
treeData.value = handleTreeData({
|
|
116
|
+
treeNodes: res.result || [],
|
|
117
|
+
allNodes,
|
|
118
|
+
handleNodeData: (node) => ({
|
|
119
|
+
isLeaf: node?.attributes?.childrenCount === "0" || node.type === "user",
|
|
120
|
+
title: node.name
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
init.value = false;
|
|
124
|
+
}
|
|
125
|
+
} catch (e) {
|
|
126
|
+
console.log(e);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function handleSelect(keys) {
|
|
130
|
+
checkedKeys.value = keys;
|
|
131
|
+
}
|
|
132
|
+
async function handleSearchFn(val) {
|
|
133
|
+
if (isEmptyText(val)) {
|
|
134
|
+
for (const node of allNodes.values()) node.style = Object.assign({}, node.style, { display: void 0 });
|
|
135
|
+
expandedKeys.value = [];
|
|
136
|
+
loadedKeys.value = [];
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (isNil(tenantId) || isNil(tenantId?.value)) return;
|
|
140
|
+
let res;
|
|
141
|
+
const params = {
|
|
142
|
+
tenantId: tenantId.value,
|
|
143
|
+
name: val,
|
|
144
|
+
status: true
|
|
145
|
+
};
|
|
146
|
+
try {
|
|
147
|
+
switch (props.type) {
|
|
148
|
+
case ModalType.DEPARTMENT:
|
|
149
|
+
res = await service.getDepartmentIdsByKeyword(params);
|
|
150
|
+
break;
|
|
151
|
+
case ModalType.USER:
|
|
152
|
+
res = await service.getDepartmentUserIdsByKeyword(params);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
if (!res?.hasError) {
|
|
156
|
+
const visibleKeys = res?.result || [];
|
|
157
|
+
expandedKeys.value = res?.result || [];
|
|
158
|
+
const visibleKeySet = new Set(visibleKeys);
|
|
159
|
+
for (const [key, node] of allNodes.entries()) if (visibleKeySet.has(key) || node.title.indexOf(val) > -1) node.style = Object.assign({}, node.style, { display: void 0 });
|
|
160
|
+
else node.style = Object.assign({}, node.style, { display: "none" });
|
|
161
|
+
}
|
|
162
|
+
} catch (e) {
|
|
163
|
+
console.log(e);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const handleSearch = useDebounceFn((val) => {
|
|
167
|
+
handleSearchFn(val);
|
|
168
|
+
}, 200);
|
|
169
|
+
watch(() => checkedKeys.value, (val) => {
|
|
170
|
+
const temp = [];
|
|
171
|
+
val.forEach((item) => {
|
|
172
|
+
const node = allNodes.get(item);
|
|
173
|
+
if (!node) return;
|
|
174
|
+
switch (props.type) {
|
|
175
|
+
case ModalType.DEPARTMENT:
|
|
176
|
+
temp.push(node);
|
|
177
|
+
break;
|
|
178
|
+
default:
|
|
179
|
+
if (node?.type === "user") temp.push(node);
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
selectedData.value = temp;
|
|
184
|
+
}, { deep: true });
|
|
185
|
+
watch(() => props.value, (val) => {
|
|
186
|
+
if (!val) checkedKeys.value = [];
|
|
187
|
+
}, { immediate: true });
|
|
188
|
+
watch(() => props.visible, (val) => {
|
|
189
|
+
if (val && init.value) getUserData();
|
|
190
|
+
}, { immediate: true });
|
|
191
|
+
watch(() => searchValue.value, (val) => {
|
|
192
|
+
handleSearch(val);
|
|
193
|
+
});
|
|
194
|
+
return {
|
|
195
|
+
width: 720 * window.pageZoom,
|
|
196
|
+
checkedKeys,
|
|
197
|
+
expandedKeys,
|
|
198
|
+
loadedKeys,
|
|
199
|
+
selectedData,
|
|
200
|
+
treeData,
|
|
201
|
+
fieldNames,
|
|
202
|
+
searchValue,
|
|
203
|
+
handleCancel,
|
|
204
|
+
handleOk,
|
|
205
|
+
handleDelete,
|
|
206
|
+
onLoadData,
|
|
207
|
+
handleAllDelete,
|
|
208
|
+
handleSelect,
|
|
209
|
+
modelRef
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region ../egova-urbanpro-core/src/components/linglong/condition-panel/components/async-select-modal/index.vue
|
|
215
|
+
var _withScopeId = (n) => (pushScopeId("data-v-fa708ae3"), n = n(), popScopeId(), n);
|
|
216
|
+
var _hoisted_1 = {
|
|
217
|
+
ref: "modelRef",
|
|
218
|
+
class: "c-async-select-modal"
|
|
219
|
+
};
|
|
220
|
+
var _hoisted_2 = { class: "c-async-select-modal-box" };
|
|
221
|
+
var _hoisted_3 = { class: "c-async-select-modal-box-tree" };
|
|
222
|
+
var _hoisted_4 = { class: "c-async-select-modal-box-tree-title-box" };
|
|
223
|
+
var _hoisted_5 = { class: "c-async-select-modal-box-tree-title-box-title" };
|
|
224
|
+
var _hoisted_6 = { class: "c-async-select-modal-box-tree-content" };
|
|
225
|
+
var _hoisted_7 = {
|
|
226
|
+
key: 0,
|
|
227
|
+
class: "zt-color-iconfont zt-icon-color-folder"
|
|
228
|
+
};
|
|
229
|
+
var _hoisted_8 = {
|
|
230
|
+
key: 1,
|
|
231
|
+
class: "zt-color-iconfont zt-icon-color-user"
|
|
232
|
+
};
|
|
233
|
+
var _hoisted_9 = {
|
|
234
|
+
key: 2,
|
|
235
|
+
class: "zt-color-iconfont zt-icon-color-box"
|
|
236
|
+
};
|
|
237
|
+
var _hoisted_10 = { class: "c-async-select-modal-box-selected" };
|
|
238
|
+
var _hoisted_11 = { class: "c-async-select-modal-box-selected-title-box" };
|
|
239
|
+
var _hoisted_12 = { class: "c-async-select-modal-box-selected-title-box-title" };
|
|
240
|
+
var _hoisted_13 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("i", { class: "zt-iconfont zt-icon-delete" }, null, -1));
|
|
241
|
+
var _hoisted_14 = {
|
|
242
|
+
key: 1,
|
|
243
|
+
class: "c-async-select-modal-box-selected-list"
|
|
244
|
+
};
|
|
245
|
+
var _hoisted_15 = ["onClick"];
|
|
246
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
247
|
+
const _component_zt_text_search = ZtTextSearch;
|
|
248
|
+
const _component_zt_tree_search = ZtTreeSearch;
|
|
249
|
+
const _component_zt_empty = ZtEmpty;
|
|
250
|
+
const _component_a_modal = Modal;
|
|
251
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(_component_a_modal, {
|
|
252
|
+
visible: _ctx.visible,
|
|
253
|
+
"get-container": () => _ctx.modelRef,
|
|
254
|
+
width: _ctx.width,
|
|
255
|
+
title: _ctx.title,
|
|
256
|
+
onCancel: _ctx.handleCancel,
|
|
257
|
+
onOk: _ctx.handleOk
|
|
258
|
+
}, {
|
|
259
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [createElementVNode("div", _hoisted_4, [createElementVNode("span", _hoisted_5, toDisplayString(`选择${_ctx.title}`), 1)]), createElementVNode("div", _hoisted_6, [createVNode(_component_zt_tree_search, {
|
|
260
|
+
checkedKeys: _ctx.checkedKeys,
|
|
261
|
+
"onUpdate:checkedKeys": _cache[0] || (_cache[0] = ($event) => _ctx.checkedKeys = $event),
|
|
262
|
+
expandedKeys: _ctx.expandedKeys,
|
|
263
|
+
"onUpdate:expandedKeys": _cache[1] || (_cache[1] = ($event) => _ctx.expandedKeys = $event),
|
|
264
|
+
searchValue: _ctx.searchValue,
|
|
265
|
+
"onUpdate:searchValue": _cache[2] || (_cache[2] = ($event) => _ctx.searchValue = $event),
|
|
266
|
+
"tree-data": _ctx.treeData,
|
|
267
|
+
"load-data": _ctx.onLoadData,
|
|
268
|
+
"loaded-keys": _ctx.loadedKeys,
|
|
269
|
+
"show-icon": "",
|
|
270
|
+
"block-node": "",
|
|
271
|
+
"field-names": _ctx.fieldNames,
|
|
272
|
+
onSelect: _ctx.handleSelect
|
|
273
|
+
}, {
|
|
274
|
+
icon: withCtx(({ dataRef }) => [dataRef.type === "department" ? (openBlock(), createElementBlock("i", _hoisted_7)) : dataRef.type === "user" ? (openBlock(), createElementBlock("i", _hoisted_8)) : (openBlock(), createElementBlock("i", _hoisted_9))]),
|
|
275
|
+
title: withCtx(({ name }) => [createVNode(_component_zt_text_search, {
|
|
276
|
+
text: name,
|
|
277
|
+
search: _ctx.searchValue
|
|
278
|
+
}, null, 8, ["text", "search"])]),
|
|
279
|
+
_: 1
|
|
280
|
+
}, 8, [
|
|
281
|
+
"checkedKeys",
|
|
282
|
+
"expandedKeys",
|
|
283
|
+
"searchValue",
|
|
284
|
+
"tree-data",
|
|
285
|
+
"load-data",
|
|
286
|
+
"loaded-keys",
|
|
287
|
+
"field-names",
|
|
288
|
+
"onSelect"
|
|
289
|
+
])])]), createElementVNode("div", _hoisted_10, [createElementVNode("div", _hoisted_11, [createElementVNode("span", _hoisted_12, toDisplayString(`已选${_ctx.title}`), 1), createElementVNode("span", {
|
|
290
|
+
class: "c-async-select-modal-box-selected-title-box-action",
|
|
291
|
+
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleAllDelete && _ctx.handleAllDelete(...args))
|
|
292
|
+
}, [_hoisted_13, createTextVNode("清空")])]), !_ctx.selectedData.length ? (openBlock(), createBlock(_component_zt_empty, {
|
|
293
|
+
key: 0,
|
|
294
|
+
center: ""
|
|
295
|
+
})) : (openBlock(), createElementBlock("div", _hoisted_14, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectedData, (item) => {
|
|
296
|
+
return openBlock(), createElementBlock("div", {
|
|
297
|
+
key: item.id,
|
|
298
|
+
class: "c-async-select-modal-box-selected-list-item"
|
|
299
|
+
}, [createElementVNode("span", null, toDisplayString(item.name), 1), createElementVNode("i", {
|
|
300
|
+
class: "zt-iconfont zt-icon-close",
|
|
301
|
+
onClick: ($event) => _ctx.handleDelete(item.id)
|
|
302
|
+
}, null, 8, _hoisted_15)]);
|
|
303
|
+
}), 128))]))])])]),
|
|
304
|
+
_: 1
|
|
305
|
+
}, 8, [
|
|
306
|
+
"visible",
|
|
307
|
+
"get-container",
|
|
308
|
+
"width",
|
|
309
|
+
"title",
|
|
310
|
+
"onCancel",
|
|
311
|
+
"onOk"
|
|
312
|
+
])], 512);
|
|
313
|
+
}
|
|
314
|
+
var async_select_modal_default = /* @__PURE__ */ _plugin_vue_export_helper_default(index_ts_vue_type_script_src_true_lang_default, [["render", _sfc_render], ["__scopeId", "data-v-fa708ae3"]]);
|
|
315
|
+
//#endregion
|
|
316
|
+
export { async_select_modal_default as t };
|