sohelp-eleplus 1.1.19 → 1.1.20

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.
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { Filter, Search, Sort, SortDown, SortUp,Setting,Tickets,Postcard, Files, Grid} from "@element-plus/icons-vue";
2
+ import { Filter, Search, Sort, SortDown, SortUp,Setting,Memo,Menu,Tickets,Postcard, Files, Grid, Refresh} from "@element-plus/icons-vue";
3
3
  import { useMobile } from "@/utils/use-mobile";
4
4
  import { usePermission } from "@/utils/use-permission";
5
5
  import DefaultProps from "./js/DefaultProps";
@@ -12,6 +12,7 @@ import { useFormData } from "@/utils/use-form-data";
12
12
  import { resetCommonConfig, updateCommonConfig } from "../http/ModuleHttp.js";
13
13
  import CrudHttp from "../http/CrudHttp.js";
14
14
  import {merge, cloneDeep } from "lodash-es";
15
+ import { uuid } from "../utils/core.js"
15
16
 
16
17
  import ApprovalModal from "../sohelp-workflow-drawer/components/approval-modal.vue";
17
18
  import WorkflowDrawer from "../sohelp-workflow-drawer/index.vue";
@@ -22,10 +23,11 @@ import FilterConditionItem from "./components/filter-condition-item.vue";
22
23
  import { useSohelpGridConfig } from "./js/useSohelpGridConfig.js";
23
24
  import { useI18n } from "vue-i18n";
24
25
  import SohelpEntityForm from "../sohelp-entity-form/index.vue";
25
- import * as ElementPlusIcons from '@element-plus/icons-vue';
26
- import * as EleAdminPlusIcons from '@/components/icons';
26
+ import * as ElementPlusIcons from '@element-plus/icons-vue';
27
+ import * as EleAdminPlusIcons from '@/components/icons';
27
28
  import { moduleCache } from "../cache/ModuleCache.js";
28
29
  import SohelpModal from "../sohelp-modal/index.vue";
30
+ import SohelpImport from "../sohelp-import/index.vue";
29
31
  import { useUserStore } from '@/store/modules/user';
30
32
  import { Alert } from "vxe-pc-ui";
31
33
  const { initial, isConfigDone } = useSohelpGridConfig();
@@ -49,6 +51,12 @@ const currentReportValue = ref(null);
49
51
  const visibleReport = ref(false);
50
52
  const reportData = ref([]);
51
53
  const currentRow = ref(null);
54
+
55
+ /** 自动生成ID */
56
+ const getId = () => {
57
+ return 'sohelp-grid-' + uuid();
58
+ }
59
+
52
60
  const loadReport = () => {
53
61
  SohelpHttp.get("/engine/web/report/list", { refid: props.refid }).then(res => {
54
62
  if (res.meta.success) {
@@ -89,6 +97,9 @@ const closeReport = () => {
89
97
  visibleReport.value = false;
90
98
  };
91
99
 
100
+ // 操作栏按钮配置
101
+ const operationsButtons = reactive({});
102
+
92
103
  const loading = ref(false);
93
104
  //显示实体表单
94
105
  const visibleEntityForm = ref(false);
@@ -195,7 +206,7 @@ const getCellValue = (rowIndex, name) => {
195
206
  */
196
207
  const getKeywordsPlaceholder = computed(() => {
197
208
  if (sohelpConfig.value?.filter?.keywords?.length) {
198
- return t("grid.toolbar.keywords") + ",【" + sohelpConfig.value.filter?.keywords?.filter(key => propertiesMap.value[key]).map(key => t(propertiesMap.value[key].i18n) || propertiesMap.value[key].label).join("/") + "";
209
+ return t("grid.toolbar.keywords") + " [" + sohelpConfig.value.filter?.keywords?.filter(key => propertiesMap.value[key]).map(key => t(propertiesMap.value[key].i18n) || propertiesMap.value[key].label).join(",") + "]";
199
210
  }
200
211
  return t("grid.toolbar.keywords");
201
212
  });
@@ -208,6 +219,107 @@ const getCurrentFieldLabel = computed(() => {
208
219
  return (propertiesMap.value[textareaState["field"]]?.label || "") + "修改";
209
220
  });
210
221
 
222
+ const importVisible = ref(false);
223
+ const importAuthority = computed(() => {
224
+ try {
225
+ const prefix = (props.refid || '').split('!')[0] || '';
226
+ return prefix + ':batch.import';
227
+ } catch (e) {
228
+ return 'batch.import';
229
+ }
230
+ });
231
+ const exportAuthority = computed(() => {
232
+ try {
233
+ const prefix = (props.refid || '').split('!')[0] || '';
234
+ return prefix + ':batch.export';
235
+ } catch (e) {
236
+ return 'batch.export';
237
+ }
238
+ });
239
+
240
+ const openImport = () => {
241
+ try {
242
+ if (!permission.hasPermission(importAuthority.value)) {
243
+ EleMessage.error('暂无权限');
244
+ return;
245
+ }
246
+ if (!props.refid) {
247
+ EleMessage.error('列表地址缺失,无法打开导入');
248
+ return;
249
+ }
250
+ importVisible.value = true;
251
+ } catch (e) {
252
+ EleMessage.error(typeof e === 'string' ? e : e?.message || '打开导入失败');
253
+ }
254
+ };
255
+ const closeImport = () => {
256
+ importVisible.value = false;
257
+ };
258
+ const exportData = async (dataRange) => {
259
+ if (!permission.hasPermission(exportAuthority.value)) {
260
+ EleMessage.error('暂无权限');
261
+ return;
262
+ }
263
+ if (dataRange === 0) {
264
+ const $grid = sohelpVxeGridRef.value;
265
+ const selected = $grid?.getCheckboxRecords() || [];
266
+ if (!selected.length) {
267
+ EleMessage.error("请先勾选需要导出的记录");
268
+ return;
269
+ }
270
+ const ids = selected.map((item) => item.id).filter((id) => id !== undefined && id !== null);
271
+ if (!ids.length) {
272
+ EleMessage.error("选中记录未包含可导出的ID");
273
+ return;
274
+ }
275
+ let last = 0;
276
+ let loadingTip = EleMessage.loading("导出中 0%");
277
+ try {
278
+ await SohelpHttp.download("/engine/web/export/download", {
279
+ refid: props.refid,
280
+ exportRange: dataRange,
281
+ ...filterValue.value,
282
+ ids: ids
283
+ }, "导出数据.xlsx", (loaded, total) => {
284
+ if (total > 0) {
285
+ const p = Math.floor((loaded / total) * 100);
286
+ if (p - last >= 5) {
287
+ loadingTip.close();
288
+ loadingTip = EleMessage.loading(`导出中 ${p}%`);
289
+ last = p;
290
+ }
291
+ }
292
+ });
293
+ } catch (e) {
294
+ EleMessage.error(typeof e === "string" ? e : e?.message || "导出失败");
295
+ } finally {
296
+ loadingTip.close();
297
+ }
298
+ return;
299
+ }
300
+ let last = 0;
301
+ let loadingTip = EleMessage.loading("导出中 0%");
302
+ try {
303
+ await SohelpHttp.download("/engine/web/export/download", {
304
+ refid: props.refid,
305
+ exportRange: dataRange,
306
+ filterValue: JSON.stringify(filterValue.value)
307
+ }, "导出数据.xlsx", (loaded, total) => {
308
+ if (total > 0) {
309
+ const p = Math.floor((loaded / total) * 100);
310
+ if (p - last >= 5) {
311
+ loadingTip.close();
312
+ loadingTip = EleMessage.loading(`导出中 ${p}%`);
313
+ last = p;
314
+ }
315
+ }
316
+ });
317
+ } catch (e) {
318
+ EleMessage.error(typeof e === "string" ? e : e?.message || "导出失败");
319
+ } finally {
320
+ loadingTip.close();
321
+ }
322
+ };
211
323
  const keywordsChange = (val) => {
212
324
  filterValue.value = {
213
325
  ...filterValue.value,
@@ -328,6 +440,10 @@ const loadConfig = (param = {}) => {
328
440
  batchButtonsIndex.value = config.batchButtonsIndex;
329
441
  sohelpConfig.value.list = config.sohelpConfig.list;
330
442
 
443
+
444
+
445
+ Object.assign(operationsButtons, config.operationsButtons);
446
+
331
447
  if (!filterValue.value.filter) {
332
448
  filterValue.value.filter = [];
333
449
  }
@@ -475,55 +591,28 @@ const pageChangeEvent = (page) => {
475
591
  * 获取Common类型操作栏 并根据flw_id判断是否显示
476
592
  * @param row
477
593
  */
478
- const getOperationButtonsByType = (row, type = "common") => {
479
- let common = getOperationToolbars.value?.[type] || [];
480
- if (common.length > 0) {
481
- if (row.hasOwnProperty("flw_id")) {
482
- const field = row.flw_id === "0" ? "workflow.view" : "workflow.submit";
483
- common = common.filter(f => f.code != field);
484
- } else {
485
- common = common.filter(f => (f.code != "workflow.submit" || f.code != "workflow.view"));
486
- }
487
- return common;
488
- }
489
- return [];
490
- };
491
-
492
- /**
493
- * 获取操作栏
494
- */
495
- const getOperationToolbars = computed(() => {
496
- const buttonsMap = {};
497
- sohelpConfig.value.operationToolbars?.filter(f => !f.authority || permission.hasPermission(f.authority)).map(button => {
498
- const type = button.buttonType || "common";
499
- const code = button.type === "custom" ? button.id : button.type;
500
- if (!buttonsMap[type]) {
501
- buttonsMap[type] = [];
502
- }
503
- const title = (button.type === "custom") ? button.title : t("grid.toolbar." + button.type?.replaceAll(".", "-"));
504
- let params = button.params || {};
505
- if (button.params && typeof button.params === "string") {
506
- try {
507
- params = JSON.parse(button.params);
508
- } catch (e) {
509
- params = {};
510
- EleMessage.error("button.params配置JSON参数格式错误");
594
+ const getOperationButtonsByType = computed(() => {
595
+ return (row, column, type = "common") => {
596
+ const $grid = sohelpVxeGridRef.value;
597
+ let common = operationsButtons?.[type] || [];
598
+ if (common.length > 0) {
599
+ if (row.hasOwnProperty("flw_id")) {
600
+ const field = row.flw_id === "0" ? "workflow.view" : "workflow.submit";
601
+ common = common.filter(f => f.code != field);
602
+ } else {
603
+ common = common.filter(f => (f.code != "workflow.submit" || f.code != "workflow.view"));
511
604
  }
605
+ return common.map((item) => {
606
+ if(item.render && item.render?.length > 0) {
607
+ const func = new Function("row","item","column","$grid", `return (async () => { ${item.render} })()`);
608
+ func.call(undefined, row, item, column, $grid);
609
+ }
610
+ return item;
611
+ });
512
612
  }
513
- buttonsMap[type].push({
514
- title: title || button.title,
515
- "id": button.id,
516
- code: code,
517
- handler: button.handler,
518
- icon: button.iconCls,
519
- params: params,
520
- refid: button.refid,
521
- openType: button.openType
522
- });
523
- });
524
- return buttonsMap;
525
- });
526
-
613
+ return [];
614
+ };
615
+ })
527
616
 
528
617
  /**
529
618
  * 行操作栏点击事件
@@ -1065,7 +1154,6 @@ const viewWorkflow = (id) => {
1065
1154
  * 筛选
1066
1155
  */
1067
1156
  const changeNameFilter = (option, val, column) => {
1068
- console.log("option", option, val, column);
1069
1157
  const $grid = sohelpVxeGridRef.value;
1070
1158
  if ($grid) {
1071
1159
  $grid.setFilter(column.field, [{
@@ -1335,10 +1423,14 @@ const settingClick = (command) => {
1335
1423
  const { refid,extendEntity,name } = sohelpConfig.value;
1336
1424
  if(refid && extendEntity && name){
1337
1425
  const url = {
1338
- form: baseUrl + `/dev/index.html#/dev/form?datasource=${name}&name=${extendEntity}&refid=${refid}`,
1339
- entity: baseUrl + `/dev/index.html#/dev/module/entity?datasource=${name}&name=${extendEntity}`,
1340
- workflow: baseUrl + `/dev/index.html#/dev/form?datasource=${name}&name=${extendEntity}&refid=${refid}`,
1341
- grid: baseUrl + `/dev/index.html#/dev/module/grid?refid=${refid}`
1426
+ form: baseUrl + `/dev/index.html#/dev/form?datasource=default&name=${extendEntity}&refid=${refid}`,
1427
+ entity: baseUrl + `/dev/index.html#/dev/module/entity?datasource=default&name=${extendEntity}`,
1428
+ workflow: baseUrl + `/dev/index.html#/dev/form?datasource=default&name=${extendEntity}&refid=${refid}&tab=workflow`,
1429
+ grid: baseUrl + `/dev/index.html#/dev/module/grid?refid=${refid}`,
1430
+ module: baseUrl+`/dev/index.html#/dev/module?name=${refid}`,
1431
+ }
1432
+ if(command === 'module' && !extendEntity){
1433
+ url.module = baseUrl+`/dev/index.html#/dev/module?name=${name}`;
1342
1434
  }
1343
1435
  window.open(url[command],'_blank');
1344
1436
  }
@@ -1388,7 +1480,7 @@ defineExpose({
1388
1480
  @checkboxChange="onCheckboxChange"
1389
1481
  @checkboxAll="onCheckboxChange"
1390
1482
  class="sohelp-grid-view"
1391
- id="sohelp-grid"
1483
+ :id="getId()"
1392
1484
  v-on="gridEvents"
1393
1485
  @filter-change="handleFilterChange"
1394
1486
  @custom="handleCustom"
@@ -1401,25 +1493,31 @@ defineExpose({
1401
1493
  @filter-visible="filterVisible"
1402
1494
  >
1403
1495
 
1496
+ <!-- 自定义列设置 -->
1404
1497
  <template #setting>
1405
1498
  <div class="column-setting">
1406
1499
  <vxe-checkbox @change="toggleAllEvent" v-model="columnCheckbox">全选</vxe-checkbox>
1407
- <vxe-pulldown trigger="click" :transfer="true" :show-popup-shadow="true" v-if="userStore.info.is_developer">
1408
- <template #default>
1409
- <el-link :icon="Setting" :underline="false"></el-link>
1410
- </template>
1411
- <template #dropdown>
1412
- <ele-text @click="settingClick('grid')">数据列表配置</ele-text>
1413
- <ele-text @click="settingClick('entity')">实体配置</ele-text>
1414
- </template>
1415
- </vxe-pulldown>
1500
+ <vxe-pulldown trigger="click" :transfer="true" :show-popup-shadow="true" v-if="userStore.info.is_developer">
1501
+ <template #default>
1502
+ <el-link :icon="Setting" :underline="false"/>
1503
+ </template>
1504
+ <template #dropdown>
1505
+ <ele-card shadow="always">
1506
+ <el-space direction="vertical" :size="5" alignment="flex-start">
1507
+ <el-link :icon="Memo" @click="settingClick('grid')" :underline="false" style="font-size:12px;"><span style="padding:0 5px;">列表配置</span></el-link>
1508
+ <el-link :icon="Menu" @click="settingClick('entity')" :underline="false" style="font-size: 12px;"><span style="padding:0 5px;">实体配置</span></el-link>
1509
+ <el-link :icon="Grid" @click="settingClick('module')" :underline="false" style="font-size: 12px;"><span style="padding:0 5px;">模块配置</span></el-link>
1510
+ </el-space>
1511
+ </ele-card>
1512
+ </template>
1513
+ </vxe-pulldown>
1416
1514
  </div>
1417
1515
  </template>
1418
1516
 
1419
1517
  <!--定义国际化I18n-->
1420
1518
  <template
1421
1519
  v-for="item in sohelpConfig?.properties?.map(item => item)"
1422
- v-slot:[`header_${item.name}`]="{ column, rowIndex }"
1520
+ #[`header_${item.name}`]="{ column, rowIndex }"
1423
1521
  :key="item.name"
1424
1522
  >
1425
1523
  {{ item.i18n ? t(item.i18n) : item.label }}
@@ -1432,12 +1530,12 @@ defineExpose({
1432
1530
  v-model:currentPage="gridOptions.pagerConfig.currentPage"
1433
1531
  v-model:pageSize="gridOptions.pagerConfig.pageSize"
1434
1532
  :total="gridOptions.pagerConfig.total"
1435
- @page-change="pageChangeEvent">
1436
- </vxe-pager>
1533
+ @page-change="pageChangeEvent"/>
1437
1534
  </template>
1438
1535
 
1439
1536
  <!-- 高级筛选 -->
1440
- <template v-for="field in Object.values(propertiesMap).filter(item => item.query)" :key="field.name"
1537
+ <template
1538
+ v-for="field in Object.values(propertiesMap).filter(item => item.query)" :key="field.name"
1441
1539
  #[`filter_${field.name}`]="{ column }">
1442
1540
  <div v-for="(option, index) in column.filters" :key="index" class="condition-box">
1443
1541
  <filter-condition-item
@@ -1454,13 +1552,14 @@ defineExpose({
1454
1552
  <div class="toolbar-box">
1455
1553
  <!-- 查看范围 -->
1456
1554
  <div class="power-box">
1457
- <sohelp-power @change="changePower" v-if="sohelpConfig?.filter?.config?.visibleDataRange"></sohelp-power>
1555
+ <sohelp-power @change="changePower" v-if="sohelpConfig?.filter?.config?.visibleDataRange"/>
1458
1556
  </div>
1459
1557
 
1460
1558
  <div class="search-box" v-if="sohelpConfig?.filter?.config?.visibleKeywords">
1461
1559
  <!-- 关键字 -->
1462
1560
  <ele-tooltip :content="getKeywordsPlaceholder" placement="top" :offset="3">
1463
- <sohelp-input :model-value="filterValue.keywords" @update:model-value="keywordsChange"
1561
+ <sohelp-input
1562
+ :model-value="filterValue.keywords" @update:model-value="keywordsChange"
1464
1563
  :placeholder="getKeywordsPlaceholder" clearable
1465
1564
  @keyup.enter="filter" size="small" style="width: 160px;">
1466
1565
  <template #append>
@@ -1468,22 +1567,26 @@ defineExpose({
1468
1567
  </template>
1469
1568
  </sohelp-input>
1470
1569
  </ele-tooltip>
1471
- <el-button size="small" @click="resetFilter">{{ t("grid.toolbar.reset") }}</el-button>
1570
+ <el-button size="small" :icon="Refresh" @click="resetFilter">{{ t("grid.toolbar.reset") }}</el-button>
1472
1571
  </div>
1473
1572
 
1474
1573
  <div class="tools-btns">
1475
- <sohelp-drop-card :title="t('grid.toolbar.sort')" :icon="Sort" ref="sohelpSortRef"
1574
+ <sohelp-drop-card
1575
+ :title="t('grid.toolbar.sort')" :icon="Sort" ref="sohelpSortRef"
1476
1576
  v-if="sohelpConfig?.filter?.config?.visibleSort && sortList.length > 0">
1477
1577
  <div class="sort-list">
1478
- <ele-card v-for="item in sortList" :key="item.title" :header="item.title"
1578
+ <ele-card
1579
+ v-for="item in sortList" :key="item.title" :header="item.title"
1479
1580
  :bodyStyle="{padding: '0'}"
1480
1581
  :headerStyle="{fontSize: '14px', fontWeight: 'normal', padding: '5px 0'}">
1481
1582
  <template #extra>
1482
- <ele-text :icon="SortUp" style="cursor: pointer;" :underline="false" size="sm"
1583
+ <ele-text
1584
+ :icon="SortUp" style="cursor: pointer;" :underline="false" size="sm"
1483
1585
  @click="sortCommand(item.field,'asc')" plain :type="isActiveSort(item.field,'asc')">
1484
1586
  t("grid.toolbar.asc")
1485
1587
  </ele-text>
1486
- <ele-text :icon="SortDown" style="cursor: pointer;margin-left:5px!important" :underline="false"
1588
+ <ele-text
1589
+ :icon="SortDown" style="cursor: pointer;margin-left:5px!important" :underline="false"
1487
1590
  size="sm" @click="sortCommand(item.field,'desc')" plain
1488
1591
  :type="isActiveSort(item.field,'desc')">t("grid.toolbar.desc")
1489
1592
  </ele-text>
@@ -1491,11 +1594,35 @@ defineExpose({
1491
1594
  </ele-card>
1492
1595
  </div>
1493
1596
  </sohelp-drop-card>
1494
- <el-button :icon="Filter" size="small" @click="showFilter()"
1597
+ <el-button
1598
+ :icon="Filter" size="small" @click="showFilter()"
1495
1599
  plain
1496
1600
  :type="(sohelpConfig?.filter?.config?.visibleFilter && sohelpConfig?.filter?.config?.filterPosition !== 'NONE')?'primary':''"
1497
- v-if="sohelpConfig?.filter?.config?._visibleFilter">
1498
- </el-button>
1601
+ v-if="sohelpConfig?.filter?.config?._visibleFilter"/>
1602
+ <ele-tooltip :content="'批量导入数据'" placement="top" :offset="3">
1603
+ <el-button size="small" plain :icon="ElementPlusIcons.Upload" @click="openImport" v-permission="importAuthority"/>
1604
+ </ele-tooltip>
1605
+ <ele-tooltip :content="'批量导出数据'" placement="top" :offset="3">
1606
+ <el-dropdown @command="exportData" v-permission="exportAuthority">
1607
+ <el-button size="small" plain :icon="ElementPlusIcons.Download"/>
1608
+ <template #dropdown>
1609
+ <el-dropdown-menu>
1610
+ <el-dropdown-item :command="0" :disabled="!selections || selections.length === 0">
1611
+ <el-icon><Memo /></el-icon>
1612
+ <span style="margin-left:6px;">导出选中数据</span>
1613
+ </el-dropdown-item>
1614
+ <el-dropdown-item :command="1">
1615
+ <el-icon><Files /></el-icon>
1616
+ <span style="margin-left:6px;">当前页数据</span>
1617
+ </el-dropdown-item>
1618
+ <el-dropdown-item :command="2">
1619
+ <el-icon><Grid /></el-icon>
1620
+ <span style="margin-left:6px;">全部记录数据</span>
1621
+ </el-dropdown-item>
1622
+ </el-dropdown-menu>
1623
+ </template>
1624
+ </el-dropdown>
1625
+ </ele-tooltip>
1499
1626
  </div>
1500
1627
  </div>
1501
1628
  </template>
@@ -1504,11 +1631,10 @@ defineExpose({
1504
1631
  <!-- 未编辑状态 -->
1505
1632
  <template
1506
1633
  v-for="name in sohelpConfig?.properties?.map(item => item.name)"
1507
- v-slot:[`default_${name}`]="{ row, column, rowIndex }"
1634
+ #[`default_${name}`]="{ row, column, rowIndex }"
1508
1635
  :key="name"
1509
1636
  >
1510
1637
 
1511
-
1512
1638
  <sohelp-dict
1513
1639
  type="text"
1514
1640
  v-model="row[name]"
@@ -1517,20 +1643,19 @@ defineExpose({
1517
1643
  />
1518
1644
 
1519
1645
  <!-- 图片 -->
1520
- <sohelp-image-upload v-else-if="column.type === 'SohelpImageUpload'"
1646
+ <sohelp-image-upload
1647
+ v-else-if="column.type === 'SohelpImageUpload'"
1521
1648
  v-model="row[name]"
1522
1649
  v-bind="column.editRender"
1523
1650
  :data="getCellValue(rowIndex,name)"
1524
- :readonly="!column.editRender.edit">
1525
- </sohelp-image-upload>
1651
+ :readonly="!column.editRender.edit"/>
1526
1652
  <!-- 附件 -->
1527
1653
  <sohelp-file-upload
1528
1654
  v-else-if="column.type === 'SohelpFileUpload'"
1529
1655
  v-model="row[name]"
1530
1656
  v-bind="column.editRender"
1531
1657
  :data="getCellValue(rowIndex,name)"
1532
- :readonly="!column.editRender.edit">
1533
- </sohelp-file-upload>
1658
+ :readonly="!column.editRender.edit"/>
1534
1659
 
1535
1660
  <!-- 下拉选择表格 -->
1536
1661
  <div v-else-if="column.type === 'SohelpTableSelect' || column.type === 'ORG' || column.type ==='USER'">
@@ -1555,7 +1680,7 @@ defineExpose({
1555
1680
  v-bind="column.editRender"
1556
1681
  style="width: 100%"
1557
1682
  :readonly="!column.editRender.edit"
1558
- ></sohelp-process>
1683
+ />
1559
1684
 
1560
1685
 
1561
1686
  <!-- 下拉用户选择 -->
@@ -1584,7 +1709,8 @@ defineExpose({
1584
1709
  </div>
1585
1710
 
1586
1711
  <!-- 文本域 -->
1587
- <p style="margin: 0;"
1712
+ <p
1713
+ style="margin: 0;"
1588
1714
  class="textarea-reference"
1589
1715
  @click="showTextareaModal(column, name, row)"
1590
1716
  v-bind="column.editRender"
@@ -1609,7 +1735,7 @@ defineExpose({
1609
1735
  <!-- 可编辑状态 -->
1610
1736
  <template
1611
1737
  v-for="name in sohelpConfig?.properties?.map(item => item.name)"
1612
- v-slot:[`edit_${name}`]="{ row, column, rowIndex }"
1738
+ #[`edit_${name}`]="{ row, column, rowIndex }"
1613
1739
  :key="name"
1614
1740
  >
1615
1741
  <div v-if="column.editRender.enabled">
@@ -1660,11 +1786,12 @@ defineExpose({
1660
1786
  />
1661
1787
 
1662
1788
  <!-- 外键关联 -->
1663
- <sohelp-table-select v-else-if="column.type==='SohelpTableSelect'"
1789
+ <sohelp-table-select
1790
+ v-else-if="column.type==='SohelpTableSelect'"
1664
1791
  v-model:value="row[name]"
1665
1792
  v-model:data="gridData[rowIndex][name]"
1666
1793
  v-bind="column.editRender"
1667
- ></sohelp-table-select>
1794
+ />
1668
1795
 
1669
1796
  <!-- 数值 -->
1670
1797
  <sohelp-number-input
@@ -1688,10 +1815,10 @@ defineExpose({
1688
1815
  </template>
1689
1816
 
1690
1817
  <!-- 操作栏 -->
1691
- <template #_operation="{ row }">
1818
+ <template #_operation="{ row, column }">
1692
1819
  <el-space :size="10">
1693
1820
  <el-link
1694
- v-for="item in getOperationButtonsByType(row)"
1821
+ v-for="(item) in getOperationButtonsByType(row, column)"
1695
1822
  :key="item.code"
1696
1823
  :type="item.code === 'crud.delete' ? 'danger' : 'primary'"
1697
1824
  v-bind="item.params"
@@ -1705,7 +1832,7 @@ defineExpose({
1705
1832
  {{ item.title }}
1706
1833
  </el-link>
1707
1834
  <!-- 更多 -->
1708
- <el-dropdown v-if="getOperationButtonsByType(row,'more')?.length > 0">
1835
+ <el-dropdown v-if="getOperationButtonsByType(row, column,'more')?.length > 0">
1709
1836
  <el-link :underline="false">
1710
1837
  <span>更多</span>
1711
1838
  <el-icon style="margin-left: 4px;">
@@ -1714,7 +1841,8 @@ defineExpose({
1714
1841
  </el-link>
1715
1842
  <template #dropdown>
1716
1843
  <el-dropdown-menu>
1717
- <el-dropdown-item v-for="item in getOperationButtonsByType(row,'more')" :key="item.code"
1844
+ <el-dropdown-item
1845
+ v-for="item in getOperationButtonsByType(row, column, 'more')" :key="item.code"
1718
1846
  @click.stop="operationHandler({item:item, row:row,$grid:sohelpVxeGridRef})"
1719
1847
  v-bind="item.props">
1720
1848
  <el-icon v-if="item.icon">
@@ -1734,7 +1862,7 @@ defineExpose({
1734
1862
  <!-- 统计 -->
1735
1863
  <template
1736
1864
  v-for="field in footerData"
1737
- v-slot:[`footer_${field["field"]}`]="{ row, column,rowIndex}"
1865
+ #[`footer_${field["field"]}`]="{ row, column,rowIndex}"
1738
1866
  :key="field['field']"
1739
1867
  >
1740
1868
  <div v-html="row[column.field]"></div>
@@ -1753,7 +1881,7 @@ defineExpose({
1753
1881
  :showOpera="false"
1754
1882
  ref="todoDrawerRef"
1755
1883
  :key="drawerKey"
1756
- ></workflow-drawer>
1884
+ />
1757
1885
 
1758
1886
  <!-- 提交审批 -->
1759
1887
  <approval-modal
@@ -1761,66 +1889,77 @@ defineExpose({
1761
1889
  type="submit"
1762
1890
  :data="approvalData"
1763
1891
  @confirm="reload"
1764
- ></approval-modal>
1892
+ />
1765
1893
 
1766
1894
  <!-- SohelpTextareaInput 编辑弹窗 -->
1767
1895
  <ele-modal :width="460" v-model="textareaState['visible']" :title="getCurrentFieldLabel">
1768
- <sohelp-textarea-input v-model="textareaState['value']" :rows="6"></sohelp-textarea-input>
1896
+ <sohelp-textarea-input v-model="textareaState['value']" :rows="6"/>
1769
1897
  <template #footer>
1770
1898
  <el-button @click="textareaCancel">{{ t("common.cancel") }}</el-button>
1771
1899
  <el-button type="primary" @click="textareaConfirm(row, column)">{{ t("common.save") }}</el-button>
1772
1900
  </template>
1773
- </ele-modal>
1774
-
1775
- <!--实体表单-->
1776
- <sohelp-modal
1777
- :title="toolbarButtonParams?.title || ''"
1778
- :width="toolbarButtonParams?.width || 860"
1779
- :draggable="false"
1780
- v-model="visibleEntityForm" v-loading="loading">
1781
- <template #setting v-if="userStore.info.is_developer">
1782
- <ele-dropdown
1783
- :items="[
1784
- { title: '表单配置', command: 'form' , icon:Postcard},
1785
- { title: '实体配置', command: 'entity', icon:Tickets},
1786
- { title: '流程配置', command: 'workflow', icon:Files }
1787
- ]"
1788
- @command="settingClick"
1789
- >
1790
- <el-link :icon="Setting" :underline="false"></el-link>
1791
- </ele-dropdown>
1792
- </template>
1901
+ </ele-modal>
1902
+
1903
+ <!--实体表单-->
1904
+ <sohelp-modal
1905
+ :title="toolbarButtonParams?.title || ''"
1906
+ :width="toolbarButtonParams?.width || 860"
1907
+ :draggable="false"
1908
+ v-model="visibleEntityForm" v-loading="loading">
1909
+ <template #setting v-if="userStore.info.is_developer">
1910
+ <ele-dropdown
1911
+ :items="[
1912
+ { title: '表单配置', command: 'form' , icon:Postcard},
1913
+ { title: '实体配置', command: 'entity', icon:Tickets},
1914
+ { title: '流程配置', command: 'workflow', icon:Files },
1915
+ { title: '模块配置', command: 'module', icon:Grid }
1916
+ ]"
1917
+ @command="settingClick"
1918
+ >
1919
+ <el-link :icon="Setting" :underline="false"/>
1920
+ </ele-dropdown>
1921
+ </template>
1793
1922
 
1794
- <sohelp-entity-form ref="entityFormRef"
1795
- :refid="props.refid"
1796
- v-model="entityFormValue"
1797
- :data="entityFormData"
1798
- :config="entityFormConfig"
1799
- :readonly="toolbarButtonParams?.readonly"
1800
- ></sohelp-entity-form>
1801
- <template #footer v-if="!toolbarButtonParams?.readonly">
1802
- <el-button @click="closeEntityForm()">{{ t("common.close") }}</el-button>
1803
- <el-button type="primary" @click="saveEntityForm()" v-loading="loading">{{ t("common.save") }}</el-button>
1923
+ <sohelp-entity-form
1924
+ ref="entityFormRef"
1925
+ :refid="props.refid.split('!')[0]"
1926
+ v-model="entityFormValue"
1927
+ :data="entityFormData"
1928
+ :config="entityFormConfig"
1929
+ :readonly="toolbarButtonParams?.readonly"
1930
+ />
1931
+ <template #footer v-if="!toolbarButtonParams?.readonly">
1932
+ <el-button @click="closeEntityForm()">{{ t("common.close") }}</el-button>
1933
+ <el-button type="primary" @click="saveEntityForm()" v-loading="loading">{{ t("common.save") }}</el-button>
1934
+ </template>
1935
+ </sohelp-modal>
1936
+ <!--打印报表-->
1937
+ <ele-modal
1938
+ :title="toolbarButtonParams?.title|| t('grid.report.title')" :width="toolbarButtonParams?.width|| 600"
1939
+ v-model="visibleReport">
1940
+
1941
+ <ele-check-card v-model="currentReportValue" :items="reportData" :row="{ gutter: 2 }">
1942
+ <template #item="{ item }">
1943
+ <ele-text size="md" style="padding:10px;">{{ item.name }}</ele-text>
1944
+ </template>
1945
+ </ele-check-card>
1946
+
1947
+ <template #footer>
1948
+ <el-button @click="closeReport()">{{ t("common.close") }}</el-button>
1949
+ <el-button @click="designReport()" v-if="reportData && reportData.length>0">{{ t("common.design") }}</el-button>
1950
+ <el-button type="primary" @click="openReport()" v-if="reportData && reportData.length>0">{{ t("common.print") }}
1951
+ </el-button>
1804
1952
  </template>
1805
- </sohelp-modal>
1806
- <!--打印报表-->
1807
- <ele-modal :title="toolbarButtonParams?.title|| t('grid.report.title')" :width="toolbarButtonParams?.width|| 600"
1808
- v-model="visibleReport">
1809
-
1810
- <ele-check-card v-model="currentReportValue" :items="reportData" :row="{ gutter: 2 }">
1811
- <template #item="{ item }">
1812
- <ele-text size="md" style="padding:10px;">{{ item.name }}</ele-text>
1953
+ </ele-modal>
1954
+ <!--数据导入-->
1955
+ <sohelp-import
1956
+ :model-value="importVisible"
1957
+ :refid="props.refid"
1958
+ :fields="sohelpConfig?.properties || []"
1959
+ @update:modelValue="(v) => importVisible = v"
1960
+ @close="closeImport"
1961
+ />
1813
1962
  </template>
1814
- </ele-check-card>
1815
-
1816
- <template #footer>
1817
- <el-button @click="closeReport()">{{ t("common.close") }}</el-button>
1818
- <el-button @click="designReport()" v-if="reportData && reportData.length>0">{{ t("common.design") }}</el-button>
1819
- <el-button type="primary" @click="openReport()" v-if="reportData && reportData.length>0">{{ t("common.print") }}
1820
- </el-button>
1821
- </template>
1822
- </ele-modal>
1823
- </template>
1824
1963
 
1825
1964
  <style scoped lang="scss">
1826
1965
  .sohelp-grid-view {
@@ -1962,4 +2101,6 @@ defineExpose({
1962
2101
 
1963
2102
 
1964
2103
 
2104
+
2105
+
1965
2106
  </style>