cloud-web-corejs-haier 1.0.43 → 1.0.45

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 (228) hide show
  1. package/package.json +8 -6
  2. package/src/api/user.js +54 -46
  3. package/src/components/baseAlert/index.vue +57 -53
  4. package/src/components/baseInputExport/index.vue +3 -3
  5. package/src/components/baseTabs/mixins.js +12 -1
  6. package/src/components/errorMsg/index.vue +78 -78
  7. package/src/components/excelExport/button.vue +54 -45
  8. package/src/components/excelExport/exportFieldDialog.vue +3 -3
  9. package/src/components/excelExport/index.js +1 -43
  10. package/src/components/excelExport/index.vue +62 -34
  11. package/src/components/excelExport/mixins.js +74 -87
  12. package/src/components/excelImport/index.js +1 -62
  13. package/src/components/excelImport/mixins.js +1 -774
  14. package/src/components/fileLibrary/index.vue +113 -33
  15. package/src/components/fileLibrary/propertiesDialog.vue +6 -0
  16. package/src/components/hiprint/view/design/index.vue +139 -47
  17. package/src/components/hiprint/view/design/preview.vue +75 -52
  18. package/src/components/hiprint/view/json-view.vue +31 -31
  19. package/src/components/luckysheet/dialog.vue +159 -0
  20. package/src/components/luckysheet/export.js +595 -0
  21. package/src/components/luckysheet/fileUtils.js +147 -0
  22. package/src/components/luckysheet/index.js +69 -0
  23. package/src/components/luckysheet/templateJson.js +12078 -0
  24. package/src/components/luckysheet/view.vue +210 -0
  25. package/src/components/onlineTalk/index.vue +328 -6
  26. package/src/components/onlineTalk/talkUserDialog.vue +280 -0
  27. package/src/components/wf/addTaskUserdialog.vue +5 -5
  28. package/src/components/wf/content.vue +1244 -1169
  29. package/src/components/wf/content2.vue +604 -604
  30. package/src/components/wf/mixins/setCandidateDialog.js +228 -2
  31. package/src/components/wf/mixins/setCandidateDialog2.js +116 -101
  32. package/src/components/wf/mixins/wfTaskUserRangeDialog.js +67 -1
  33. package/src/components/wf/setCandidateDialog.vue +5 -7
  34. package/src/components/wf/setCandidateDialog2.vue +14 -10
  35. package/src/components/wf/wf.js +2325 -2209
  36. package/src/components/wf/wfTaskUserRangeDialog.vue +1 -1
  37. package/src/components/wf/wfUtil.js +129 -91
  38. package/src/components/xform/form-designer/designer.js +1994 -9
  39. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +10 -0
  40. package/src/components/xform/form-designer/form-widget/container-widget/detail-pane-widget.vue +3 -2
  41. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +5 -1
  42. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin - /345/211/257/346/234/254.js" +1639 -0
  43. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1756 -2
  44. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +1 -0
  45. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +10 -1
  46. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +170 -0
  47. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1630 -1
  48. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +153 -40
  49. package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +65 -46
  50. package/src/components/xform/form-designer/form-widget/field-widget/vue-page-widget.vue +231 -0
  51. package/src/components/xform/form-designer/setting-panel/form-setting.vue +7 -4
  52. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/edit-tree-button-group-config-dialog.vue +281 -0
  53. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +659 -221
  54. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +3 -3
  55. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +133 -0
  56. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +14 -6
  57. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +1 -1
  58. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +1 -1
  59. package/src/components/xform/form-designer/setting-panel/property-editor/field-vue-page/vue-page-editor.vue +48 -0
  60. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconClass-editor.vue +18 -17
  61. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +26 -26
  62. package/src/components/xform/form-designer/setting-panel/property-editor/labelTooltip-editor.vue +67 -13
  63. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +2 -0
  64. package/src/components/xform/form-designer/setting-panel/property-editor/showViewButton-editor.vue +29 -0
  65. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +8 -6
  66. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1 -0
  67. package/src/components/xform/form-render/container-item/data-table-mixin.js +20 -17
  68. package/src/components/xform/form-render/container-item/detail-item.vue +72 -48
  69. package/src/components/xform/form-render/container-item/sub-form-item.vue +10 -2
  70. package/src/components/xform/form-render/container-item/table2-item.vue +40 -10
  71. package/src/components/xform/form-render/indexMixin.js +3705 -1
  72. package/src/components/xform/icon-picker/icons.json +284 -0
  73. package/src/components/xform/icon-picker/index.vue +145 -0
  74. package/src/components/xform/lang/zh-CN.js +2 -1
  75. package/src/components/xform/mixins/defaultHandle.js +366 -2
  76. package/src/components/xform/utils/formula-util.js +3 -0
  77. package/src/components/xform/utils/sfc-generator.js +2 -2
  78. package/src/components/xform/utils/smart-vue-i18n/index.js +2 -1
  79. package/src/components/xform/utils/tableColumnHelper.js +54 -10
  80. package/src/components/xform/utils/util.js +1547 -1
  81. package/src/index.js +190 -211
  82. package/src/lang/locale/en/login.js +26 -19
  83. package/src/lang/locale/zh/login.js +25 -19
  84. package/src/layout/components/Sidebar/default.vue +252 -71
  85. package/src/layout/components/Sidebar/index.vue +6 -1
  86. package/src/layout/components/TagsView/index.vue +6 -0
  87. package/src/layout/components/langTool.vue +32 -29
  88. package/src/layout/defaultLayout.vue +16 -8
  89. package/src/layout/index.vue +5 -3
  90. package/src/permission.js +135 -1
  91. package/src/router/index.js +1 -4
  92. package/src/store/config/index.js +667 -1
  93. package/src/store/getters.js +2 -1
  94. package/src/store/modules/permission.js +332 -1
  95. package/src/store/modules/settings.js +26 -1
  96. package/src/store/modules/tagsView.js +190 -1
  97. package/src/store/modules/user.js +358 -1
  98. package/src/utils/aes.js +15 -1
  99. package/src/utils/auth.js +27 -1
  100. package/src/utils/componentDialog.js +217 -0
  101. package/src/utils/request.js +368 -1
  102. package/src/utils/vab.js +1256 -7
  103. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -174
  104. package/src/views/bd/setting/bd_company_env/edit.vue +193 -193
  105. package/src/views/bd/setting/formVersion/button.vue +55 -0
  106. package/src/views/bd/setting/formVersion/compareBasicSection.vue +125 -0
  107. package/src/views/bd/setting/formVersion/compareCodeSection.vue +539 -0
  108. package/src/views/bd/setting/formVersion/compareContMixin.scss +65 -0
  109. package/src/views/bd/setting/formVersion/compareContent.vue +63 -0
  110. package/src/views/bd/setting/formVersion/compareDialog.vue +88 -0
  111. package/src/views/bd/setting/formVersion/compareMixin.js +93 -0
  112. package/src/views/bd/setting/formVersion/fieldCompare.vue +54 -0
  113. package/src/views/bd/setting/formVersion/formScriptCompareView.vue +94 -0
  114. package/src/views/bd/setting/formVersion/formTemplateCompareView.vue +74 -0
  115. package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +491 -0
  116. package/src/views/bd/setting/formVersion/link.vue +58 -0
  117. package/src/views/bd/setting/formVersion/preformDialog.vue +87 -0
  118. package/src/views/bd/setting/formVersion/reverButton.vue +82 -0
  119. package/src/views/bd/setting/formVersion/tableDetailDiff.js +99 -0
  120. package/src/views/bd/setting/formVersion/tableModelCompareView.vue +514 -0
  121. package/src/views/bd/setting/formVersion/textDiff.js +102 -0
  122. package/src/views/bd/setting/form_import_log/edit.vue +6 -3
  123. package/src/views/bd/setting/form_import_log/list.vue +5 -0
  124. package/src/views/bd/setting/form_script/edit.vue +196 -83
  125. package/src/views/bd/setting/form_script/edit1.vue +410 -220
  126. package/src/views/bd/setting/form_script/form_list.vue +19 -0
  127. package/src/views/bd/setting/form_script/list.vue +95 -21
  128. package/src/views/bd/setting/form_script/list1.vue +24 -0
  129. package/src/views/bd/setting/form_script/mixins/dialog.js +2 -2
  130. package/src/views/bd/setting/form_script/mixins/edit.js +265 -207
  131. package/src/views/bd/setting/form_script/mixins/edit1.js +259 -201
  132. package/src/views/bd/setting/form_script/mixins/form_list.js +322 -296
  133. package/src/views/bd/setting/form_script/mixins/list.js +163 -95
  134. package/src/views/bd/setting/form_script/mixins/list1.js +244 -155
  135. package/src/views/bd/setting/form_script/mixins/otherAuthDialog.js +1 -1
  136. package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +1 -1
  137. package/src/views/bd/setting/form_template/edit.vue +355 -205
  138. package/src/views/bd/setting/form_template/formDesignerDialog.vue +171 -0
  139. package/src/views/bd/setting/form_template/list.vue +49 -74
  140. package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +3 -3
  141. package/src/views/bd/setting/form_template/mixins/edit.js +51 -8
  142. package/src/views/bd/setting/form_template/mixins/itemList.js +1 -1
  143. package/src/views/bd/setting/form_template/mixins/list.js +114 -82
  144. package/src/views/bd/setting/form_template/mixins/list2.js +3 -3
  145. package/src/views/bd/setting/form_template/mixins/otherAuthDialog.js +1 -1
  146. package/src/views/bd/setting/form_template/mixins/wf_list.js +3 -7
  147. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +254 -254
  148. package/src/views/bd/setting/form_template/wf_list.vue +161 -127
  149. package/src/views/bd/setting/request_async_setting/edit.vue +320 -320
  150. package/src/views/bd/setting/request_setting/edit.vue +300 -300
  151. package/src/views/bd/setting/request_setting/list.vue +15 -25
  152. package/src/views/bd/setting/table_model/edit.vue +702 -498
  153. package/src/views/bd/setting/table_model/list.vue +28 -0
  154. package/src/views/bd/setting/table_model/mixins/dialog.js +1 -1
  155. package/src/views/bd/setting/table_model/mixins/edit copy.js +903 -0
  156. package/src/views/bd/setting/table_model/mixins/edit.js +228 -121
  157. package/src/views/bd/setting/table_model/mixins/list.js +55 -20
  158. package/src/views/bd/setting/table_model/mixins/otherAuthDialog.js +1 -1
  159. package/src/views/bd/setting/table_model/mixins/zdDialog.js +50 -46
  160. package/src/views/bd/setting/utils/index.js +15 -0
  161. package/src/views/user/api_request/list.vue +203 -203
  162. package/src/views/user/bill_setting/list.vue +345 -345
  163. package/src/views/user/code_rules/list.vue +204 -204
  164. package/src/views/user/common_attribute/list.vue +378 -378
  165. package/src/views/user/common_script/list.vue +341 -341
  166. package/src/views/user/company_info/dialog.vue +80 -49
  167. package/src/views/user/country/list.vue +197 -197
  168. package/src/views/user/extend_datasource/dialog.vue +0 -3
  169. package/src/views/user/extend_datasource/edit.vue +1 -2
  170. package/src/views/user/extend_datasource/list.vue +221 -224
  171. package/src/views/user/fieldTranslation/editDialog.vue +1 -1
  172. package/src/views/user/fieldTranslation/list.vue +473 -473
  173. package/src/views/user/field_values_invisible/list.vue +207 -207
  174. package/src/views/user/file_type/list.vue +271 -271
  175. package/src/views/user/file_view_area/list.vue +331 -331
  176. package/src/views/user/form/vform/designer.vue +303 -287
  177. package/src/views/user/form/vform/formFieldMapping.js +2 -3
  178. package/src/views/user/form/view/edit.vue +19 -1
  179. package/src/views/user/form/view/list.vue +59 -17
  180. package/src/views/user/groups/list.vue +158 -158
  181. package/src/views/user/home/default.vue +274 -182
  182. package/src/views/user/home/default2.vue +1148 -0
  183. package/src/views/user/home/index.vue +2 -1
  184. package/src/views/user/lang_tag/list.vue +170 -170
  185. package/src/views/user/language_setting/list.vue +208 -208
  186. package/src/views/user/ledger_library/list.vue +12 -10
  187. package/src/views/user/login/default.vue +1 -1
  188. package/src/views/user/login/indexMixin.js +204 -169
  189. package/src/views/user/menu/list.vue +575 -575
  190. package/src/views/user/notify_message/dialog.vue +7 -1
  191. package/src/views/user/notify_template/list.vue +192 -192
  192. package/src/views/user/notify_template/list2.vue +190 -190
  193. package/src/views/user/position/list.vue +188 -188
  194. package/src/views/user/project_tag/list.vue +175 -175
  195. package/src/views/user/push_setting/list.vue +236 -236
  196. package/src/views/user/request_setting/list.vue +248 -248
  197. package/src/views/user/role/list.vue +182 -182
  198. package/src/views/user/system_notice/infoDialog.vue +61 -2
  199. package/src/views/user/system_notice/list.vue +203 -203
  200. package/src/views/user/system_parameter/list.vue +141 -141
  201. package/src/views/user/user/edit.vue +45 -0
  202. package/src/views/user/user/form_list.vue +245 -245
  203. package/src/views/user/user/info.vue +253 -140
  204. package/src/views/user/user_log_classify/list.vue +197 -197
  205. package/src/views/user/wf/iframe/index.vue +46 -46
  206. package/src/views/user/wf/wfReport/index.vue +1 -1
  207. package/src/views/user/wf/wf_auto_submit_data/list.vue +659 -659
  208. package/src/views/user/wf/wf_diy_attribute/edit.vue +1 -1
  209. package/src/views/user/wf/wf_manage/list.vue +795 -795
  210. package/src/views/user/wf/wf_manage/wfContentDialog.vue +106 -106
  211. package/src/views/user/wf/wf_obj_config/dialog.vue +2 -2
  212. package/src/views/user/wf/wf_obj_config/edit.vue +1 -1
  213. package/src/views/user/wf/wf_obj_config/edit_form.vue +2 -2
  214. package/src/views/user/wf/wf_obj_config/itemEdit.vue +1 -1
  215. package/src/views/user/wf/wf_obj_config/itemEdit_form.vue +1 -1
  216. package/src/views/user/wf/wf_obj_config/itemOperateDialog.vue +4 -4
  217. package/src/views/user/wf/wf_obj_config/list.vue +28 -28
  218. package/src/views/user/wf/wf_obj_config/list_form.vue +5 -5
  219. package/src/views/user/wf/wf_obj_config/wfBizDataSettingDialog.vue +292 -292
  220. package/src/views/user/wf/wf_param/edit.vue +1 -1
  221. package/src/views/user/wf/wf_transfer_setting/edit.vue +1 -1
  222. package/src/views/user/wf/wf_transfer_setting/list.vue +321 -319
  223. package/src/views/user/wf/wf_work_calendar/components/calendar.vue +369 -367
  224. package/src/views/user/wf/wf_work_calendar/components/calendar2.vue +401 -399
  225. package/src/views/user/wf/wf_work_calendar/configDialog.vue +6 -6
  226. package/src/views/user/wf/wf_work_calendar/date.js +84 -83
  227. package/src/views/user/wf/wf_work_calendar/list.vue +6 -6
  228. package/src/views/user/workbench_menu/list.vue +555 -0
@@ -1,473 +1,473 @@
1
- <template>
2
- <div id="containt">
3
- <el-tabs v-model="activeName" class="tab-box">
4
- <el-tab-pane :label="$t1('列表')" name="second">
5
- <div class="tree-box fl">
6
- <div class="tit"><b>{{ $t1('数据类型') }}</b></div>
7
- <el-tree
8
- :props="defaultProps"
9
- :load="loadNode"
10
- node-key="id"
11
- ref="tree"
12
- highlight-current
13
- lazy
14
- :expand-on-click-node="false"
15
- @node-click="handleNodeClick"
16
- class="tree-list"
17
- icon-class="el-icon-arrow-down"
18
- v-if="showTree"
19
- ></el-tree>
20
- </div>
21
- <label id="labBtn">
22
- <div class="icon">
23
- <i class="el-icon-more"></i>
24
- <i class="el-icon-more"></i>
25
- </div>
26
- </label>
27
- <div class="main-right fr" style="padding-left:6px;">
28
- <div class="grid-height">
29
- <vxe-grid ref="table-m1" v-bind="vxeOption" @resizable-change="$vxeTableUtil.onColumnWitchChange"
30
- @custom="$vxeTableUtil.customHandle">
31
- <template #form>
32
- <tableForm :formData.sync="formData" @searchEvent="searchEvent" @resetEvent="resetEvent">
33
- <template #buttonLeft>
34
- <vxe-button status="primary" class="button-sty" icon="el-icon-plus"
35
- @click="openFieldTranslationEditDialog()" :disabled="!currentDataType.id" v-if="isDev">
36
- {{ $t1('新增') }}
37
- </vxe-button>
38
- <base-table-export :option="{ title: $t1('多语言'), targetRef: 'table-m1'}"
39
- :parent-target="_self" :disabled="!currentDataType.id" v-if="isDev"/>
40
- <vxe-button status="primary" class="button-sty" icon="el-icon-download" @click="importExcel"
41
- :disabled="!currentDataType.id" v-if="isDev">{{ $t1('导入') }}
42
- </vxe-button>
43
- <vxe-button status="success" class="button-sty" icon="el-icon-download" @click="jsonImport">
44
- {{ $t1('导入发布') }}
45
- </vxe-button>
46
- <vxe-button status="success" class="button-sty" icon="el-icon-upload2" @click="jsonExport"
47
- v-if="isDev">{{ $t1('导出发布') }}
48
- </vxe-button>
49
- <!-- <langTagAddButton :option="addProjectTagOption" v-if="isDev"></langTagAddButton>
50
- <langTagDeleteButton :option="deleteProjectTagOption" v-if="isDev"></langTagDeleteButton>-->
51
- </template>
52
- <template #buttonRight>
53
- <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
54
- plain>{{ $t1('重置') }}
55
- </vxe-button>
56
- <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
57
- {{ $t1('搜索') }}
58
- </vxe-button>
59
- </template>
60
- <template #dataTypeName>
61
- <vxe-form-item :title="$t1('数据类型')+':'" field="dataTypeName">
62
- <template v-slot>
63
- <el-input v-model="currentDataType.dataTypeName" size="small" disabled/>
64
- </template>
65
- </vxe-form-item>
66
- </template>
67
- <!-- <template #tag>
68
- <vxe-form-item :title="$t1('多语言标签')+':'" field="tag">
69
- <template v-slot>
70
- <el-input
71
- class="search-input"
72
- max="200"
73
- :value="getTabNames()"
74
- @clear="
75
- checkTags = [];
76
- "
77
- v-el-readonly
78
- clearable
79
- >
80
- <i slot="suffix" class="el-input__icon el-icon-search" @click="openLangTagDialog3"></i>
81
- </el-input>
82
- </template>
83
- </vxe-form-item>
84
- </template>-->
85
- </tableForm>
86
- </template>
87
- <!-- <template #tag="{row}">
88
- <langTagView v-model="row.fieldTranslationTagDTOs" :readonly="true"></langTagView>
89
- </template>-->
90
- </vxe-grid>
91
- </div>
92
- </div>
93
- </el-tab-pane>
94
- </el-tabs>
95
- <fieldTranslationEditDialog v-if="showFieldTranslationEditDialog" :visiable.sync="showFieldTranslationEditDialog"
96
- :_dataId.sync="dataId" :currentDataType="currentDataType"
97
- @confirm="confirmFieldTranslationEditDialog"></fieldTranslationEditDialog>
98
- <!-- <langTagDialog v-if="showLangTagDialog3"
99
- :visiable.sync="showLangTagDialog3"
100
- @confirm="confirmLangTagDialog3"
101
- :rows="checkTags"
102
- :multi="true"></langTagDialog>-->
103
- </div>
104
- </template>
105
-
106
- <script>
107
- import fieldTranslationEditDialog from "../../../views/user/fieldTranslation/editDialog.vue";
108
- import {treeScollx} from '@base/utils/global.js';
109
- import {getBdFlag} from "@base/api/user";
110
- import tableForm from "@base/components/table/tableForm.vue";
111
- /*import langTagDialog from "../../../views/user/lang_tag/dialog.vue";
112
- import langTagAddButton from "@base/components/langTag/addButton.vue";
113
- import langTagDeleteButton from "@base/components/langTag/deleteButton.vue";
114
- import langTagView from "@base/components/langTag/view.vue";*/
115
-
116
- export default {
117
- name: 'fieldTranslation:list',
118
- components: {
119
- tableForm, fieldTranslationEditDialog/*, langTagView,
120
- langTagDialog, langTagAddButton, langTagDeleteButton*/
121
- },
122
- data() {
123
- return {
124
- activeName: 'second',
125
- dataId: 0,
126
- showEdit: false,
127
- vxeOption: {},
128
- formData: {},
129
-
130
- defaultProps: {
131
- label: 'dataTypeName', //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
132
- children: [],
133
- isLeaf: 'leaf'
134
- },
135
- currentDataType: {},
136
- dataTypeGroup: "fieldTranslation",
137
- fieldTranslationDicts: [],
138
- fieldTranslationDictMap: {},
139
- showTree: false,
140
- showFieldTranslationEditDialog: false,
141
- languageSettings: [],
142
- addProjectTagOption: {
143
- url: USER_PREFIX + `/fieldTranslation/saveTag`,
144
- tableDatas: () => {
145
- return this.$refs["table-m1"].getCheckboxRecords(true);
146
- },
147
- reqData: (tagDatas, tableDatas) => {
148
- let sids = tableDatas.map(item => item.sid);
149
- let tagCodes = tagDatas.map(item => item.tagCode);
150
- let reqData = {
151
- tagCodes,
152
- sids
153
- };
154
- return reqData;
155
- },
156
- callback: () => {
157
- this.searchEvent()
158
- }
159
- },
160
- deleteProjectTagOption: {
161
- url: USER_PREFIX + `/fieldTranslation/deleteTag`,
162
- tableDatas: () => {
163
- return this.$refs["table-m1"].getCheckboxRecords(true);
164
- },
165
- reqData: (tagDatas, tableDatas) => {
166
- let sids = tableDatas.map(item => item.sid);
167
- let tagCodes = tagDatas.map(item => item.tagCode);
168
- let reqData = {
169
- tagCodes,
170
- sids
171
- };
172
- return reqData;
173
- },
174
- callback: () => {
175
- this.searchEvent()
176
- }
177
- },
178
- showLangTagDialog3: false,
179
- checkTags: [],
180
- isDev: true,
181
-
182
- };
183
- },
184
- async mounted() {
185
- treeScollx({target: this, type: 'default'});
186
- /*await this.$getBaseDicts({
187
- code: "fieldTranslation",
188
- success: ({dicts, dictMap}) => {
189
- this.fieldTranslationDicts = dicts;
190
- this.fieldTranslationDictMap = dictMap;
191
- }
192
- });*/
193
- await this.initLanguageSetting();
194
- this.getBdEnv();
195
- this.initTableList();
196
- },
197
- methods: {
198
- initLanguageSetting() {
199
- return this.$http({
200
- url: USER_PREFIX + `/language_setting/listPage`,
201
- method: `post`,
202
- data: {
203
- enabled: true
204
- },
205
- isLoading: true,
206
- modalStrictly: true,
207
- success: res => {
208
- this.languageSettings = res?.objx?.records || [];
209
- }
210
- });
211
- },
212
- searchEvent() {
213
- this.$refs['table-m1'].commitProxy('reload');
214
- },
215
- resetEvent() {
216
- this.formData = {};
217
- this.$refs['table-m1'].commitProxy('reload');
218
- },
219
- openEditDialog(id) {
220
- this.dataId = !id || typeof id == 'object' ? 0 : id;
221
- this.activeName = 'first';
222
- this.$openEditView('showEdit');
223
- },
224
- getSearchParam() {
225
- let tagCodes = null;
226
- if (this.checkTags.length) {
227
- tagCodes = this.checkTags.map(item => item.tagCode);
228
- }
229
- return {
230
- ...this.formData,
231
- dataTypeCode: this.currentDataType.dataTypeCode,
232
- tagCodes
233
- };
234
- },
235
- initTableList() {
236
- let that = this;
237
- let dataTypeMap = {
238
- "business": this.$t1('全局对照表'),
239
- "menus": this.$t1('菜单对照表'),
240
- }
241
- let syncColumns = []
242
- this.languageSettings.forEach(item => {
243
- syncColumns.push({
244
- title: item.languageName,
245
- field: item.translationField,
246
- width: 150
247
- })
248
- })
249
- let tableOption = {
250
- vue: this,
251
- tableRef: 'table-m1',
252
- tableName: 'user_fieldTranslation_list-m1',
253
- path: USER_PREFIX + '/fieldTranslation/listPage',
254
- param: () => {
255
- return this.getSearchParam();
256
- },
257
- config: {
258
- proxyConfig: {
259
- autoLoad: false
260
- }
261
- },
262
- columns: [
263
- {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
264
- {
265
- title: this.$t1('字段编码'),
266
- field: 'fieldCode',
267
- width: 150,
268
- fixed: 'left'
269
- },
270
- {
271
- title: this.$t1('中文'),
272
- field: 'translation1',
273
- width: 150,
274
- fixed: 'left'
275
- },
276
- ...syncColumns,
277
- {
278
- title: this.$t1('数据类型'),
279
- field: 'dataTypeName',
280
- width: 150,
281
- slots: {
282
- default: ({row}) => {
283
- return dataTypeMap[row.dataTypeCode] || '';
284
- }
285
- }
286
- },
287
- /*{
288
- title: this.$t1('多语言标签'), field: 'tag', width: 250, slots: {default: "tag"}, params: {
289
- exportVal: ({row}) => {
290
- if (row.fieldTranslationTagDTOs) {
291
- return row.fieldTranslationTagDTOs.map(item => item.tagName).join(",")
292
- }
293
- }
294
- }
295
- },*/
296
- {
297
- field: 'modifyDate',
298
- title: this.$t1('更新时间'),
299
- width: 150
300
- },
301
- {
302
- width: 47,
303
- fixed: 'right',
304
- title: '',
305
- sortable: false,
306
- slots: {
307
- default: ({row}) => {
308
- return [
309
- <div>
310
- <a
311
- href="javascript:void(0);"
312
- class="a-link"
313
- onclick={() => {
314
- this.openFieldTranslationEditDialog(row.id);
315
- }}
316
- >
317
- <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
318
- popper-class="tooltip-skin">
319
- <i class="el-icon-edit"/>
320
- </el-tooltip>
321
- </a>
322
- </div>
323
- ];
324
- }
325
- }
326
- }
327
- ],
328
- searchColumns: [
329
- {
330
- title: this.$t1('数据类型'),
331
- field: "dataTypeName",
332
- type: "input",
333
- common: true,
334
- disabled: true,
335
- defaultValueEnabled: false,
336
- slot: "dataTypeName"
337
- },
338
- {title: this.$t1('字段编码'), field: "fieldCode", type: "input", common: true},
339
- {title: this.$t1('中文'), field: "translation1", type: "input", common: true},
340
- // {title: this.$t1('多语言标签'), field: "tag", type: "input", common: true, slot: "tag"},
341
- ]
342
- };
343
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
344
- this.vxeOption = opts;
345
- this.showTree = true;
346
- });
347
- },
348
- handleNodeClick(data, node, v) {
349
- this.currentDataType = data;
350
- this.$forceUpdate();
351
- this.searchEvent();
352
- },
353
- // 异步树叶子节点懒加载逻辑
354
- loadNode(node, resolve) {
355
-
356
- let rows = [
357
- {
358
- dataTypeName: this.$t1('全局对照表'),
359
- dataTypeCode: 'business',
360
- id: 'business',
361
- leaf: true,
362
- },
363
- {
364
- dataTypeName: this.$t1('菜单对照表'),
365
- dataTypeCode: 'menus',
366
- id: 'menus',
367
- leaf: true,
368
- }
369
- ]
370
- resolve(rows);
371
- if (rows.length) {
372
- this.$nextTick(() => {
373
- let data = node.childNodes[0].data;
374
- this.$refs.tree.setCurrentKey(data);
375
- this.currentDataType = data;
376
- this.searchEvent();
377
- })
378
- }
379
- },
380
-
381
- openFieldTranslationEditDialog(id) {
382
- this.dataId = !id || typeof id == 'object' ? 0 : id;
383
- if (!this.dataId) {
384
- if (!this.currentDataType) {
385
- this.$baseAlert(this.$t1('请选择数据类型'));
386
- return
387
- }
388
- }
389
- this.showFieldTranslationEditDialog = true;
390
- },
391
- confirmFieldTranslationEditDialog(row) {
392
- this.searchEvent();
393
- },
394
- importExcel() {
395
- let that = this;
396
- let currentDataType = this.currentDataType;
397
- that.$excelImport({
398
- title: this.$t1('多语言导入({dataTypeName})', {dataTypeName: currentDataType.dataTypeName}),
399
- prefix: USER_PREFIX,
400
- excel: USER_PREFIX + '/excelTemplate/fieldTranslation/fieldTranslation.xlsx',
401
- multi: false,
402
- saveUrl: USER_PREFIX + '/fieldTranslation/importData',
403
- defaultValue: {dataTypeCode: currentDataType.dataTypeCode},
404
- callback: () => {
405
- that.searchEvent();
406
- }
407
- });
408
- },
409
- jsonImport() {
410
- this.$langImport({
411
- saveUrl: USER_PREFIX + '/fieldTranslation/import2Publish',
412
- lang: true,
413
- callback: () => {
414
- this.searchEvent();
415
- }
416
- });
417
- },
418
- jsonExport() {
419
- this.$baseConfirm(this.$t1('您确定要导出发布吗?'))
420
- .then(() => {
421
- this.$http({
422
- url: USER_PREFIX + "/fieldTranslation/export2Publish",
423
- method: `post`,
424
- data: this.getSearchParam(),
425
- isLoading: true,
426
- success: res => {
427
- let content = res.objx
428
- if (content && content !== "[]") {
429
- this.downloadTxt(content)
430
- } else {
431
- this.$baseAlert(this.$t1('不存在需要导出的数据'))
432
- }
433
- }
434
- });
435
- })
436
- .catch(() => {
437
- });
438
- },
439
- downloadTxt(content) {
440
- // 创建Blob对象
441
- const blob = new Blob([content], {type: 'text/plain;charset=utf-8'});
442
- // 创建URL
443
- const url = URL.createObjectURL(blob);
444
- // 创建a标签
445
- const link = document.createElement('a');
446
- link.href = url;
447
- link.setAttribute('download', 'fieldTranslation.txt');
448
- document.body.appendChild(link);
449
- // 触发下载
450
- link.click();
451
- // 清理
452
- document.body.removeChild(link);
453
- URL.revokeObjectURL(url);
454
- },
455
- openLangTagDialog3() {
456
- this.showLangTagDialog3 = true;
457
- },
458
- confirmLangTagDialog3(rows) {
459
- this.checkTags = rows;
460
- },
461
- getTabNames() {
462
- return this.checkTags.map(item => item.tagName).join(",");
463
- },
464
- getBdEnv() {
465
- getBdFlag({
466
- success: res => {
467
- this.isDev = res.objx == 1
468
- }
469
- });
470
- }
471
- }
472
- };
473
- </script>
1
+ <template>
2
+ <div id="containt">
3
+ <el-tabs v-model="activeName" class="tab-box">
4
+ <el-tab-pane :label="$t1('列表')" name="second">
5
+ <div class="tree-box fl">
6
+ <div class="tit"><b>{{ $t1('数据类型') }}</b></div>
7
+ <el-tree
8
+ :props="defaultProps"
9
+ :load="loadNode"
10
+ node-key="id"
11
+ ref="tree"
12
+ highlight-current
13
+ lazy
14
+ :expand-on-click-node="false"
15
+ @node-click="handleNodeClick"
16
+ class="tree-list"
17
+ icon-class="el-icon-arrow-down"
18
+ v-if="showTree"
19
+ ></el-tree>
20
+ </div>
21
+ <label id="labBtn">
22
+ <div class="icon">
23
+ <i class="el-icon-more"></i>
24
+ <i class="el-icon-more"></i>
25
+ </div>
26
+ </label>
27
+ <div class="main-right fr" style="padding-left:6px;">
28
+ <div class="grid-height">
29
+ <vxe-grid ref="table-m1" v-bind="vxeOption" @resizable-change="$vxeTableUtil.onColumnWitchChange"
30
+ @custom="$vxeTableUtil.customHandle">
31
+ <template #form>
32
+ <tableForm :formData.sync="formData" @searchEvent="searchEvent" @resetEvent="resetEvent">
33
+ <template #buttonLeft>
34
+ <vxe-button status="primary" class="button-sty" icon="el-icon-plus"
35
+ @click="openFieldTranslationEditDialog()" :disabled="!currentDataType.id" v-if="isDev">
36
+ {{ $t1('新增') }}
37
+ </vxe-button>
38
+ <base-table-export :option="{ title: $t1('多语言'), targetRef: 'table-m1'}"
39
+ :parent-target="_self" :disabled="!currentDataType.id" v-if="isDev"/>
40
+ <vxe-button status="primary" class="button-sty" icon="el-icon-download" @click="importExcel"
41
+ :disabled="!currentDataType.id" v-if="isDev">{{ $t1('导入') }}
42
+ </vxe-button>
43
+ <vxe-button status="success" class="button-sty" icon="el-icon-download" @click="jsonImport">
44
+ {{ $t1('导入发布') }}
45
+ </vxe-button>
46
+ <vxe-button status="success" class="button-sty" icon="el-icon-upload2" @click="jsonExport"
47
+ v-if="isDev">{{ $t1('导出发布') }}
48
+ </vxe-button>
49
+ <!-- <langTagAddButton :option="addProjectTagOption" v-if="isDev"></langTagAddButton>
50
+ <langTagDeleteButton :option="deleteProjectTagOption" v-if="isDev"></langTagDeleteButton>-->
51
+ </template>
52
+ <template #buttonRight>
53
+ <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
54
+ plain>{{ $t1('重置') }}
55
+ </vxe-button>
56
+ <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
57
+ {{ $t1('搜索') }}
58
+ </vxe-button>
59
+ </template>
60
+ <template #dataTypeName>
61
+ <vxe-form-item :title="$t1('数据类型')+':'" field="dataTypeName">
62
+ <template v-slot>
63
+ <el-input v-model="currentDataType.dataTypeName" size="small" disabled/>
64
+ </template>
65
+ </vxe-form-item>
66
+ </template>
67
+ <!-- <template #tag>
68
+ <vxe-form-item :title="$t1('多语言标签')+':'" field="tag">
69
+ <template v-slot>
70
+ <el-input
71
+ class="search-input"
72
+ max="200"
73
+ :value="getTabNames()"
74
+ @clear="
75
+ checkTags = [];
76
+ "
77
+ v-el-readonly
78
+ clearable
79
+ >
80
+ <i slot="suffix" class="el-input__icon el-icon-search" @click="openLangTagDialog3"></i>
81
+ </el-input>
82
+ </template>
83
+ </vxe-form-item>
84
+ </template>-->
85
+ </tableForm>
86
+ </template>
87
+ <!-- <template #tag="{row}">
88
+ <langTagView v-model="row.fieldTranslationTagDTOs" :readonly="true"></langTagView>
89
+ </template>-->
90
+ </vxe-grid>
91
+ </div>
92
+ </div>
93
+ </el-tab-pane>
94
+ </el-tabs>
95
+ <fieldTranslationEditDialog v-if="showFieldTranslationEditDialog" :visiable.sync="showFieldTranslationEditDialog"
96
+ :_dataId.sync="dataId" :currentDataType="currentDataType"
97
+ @confirm="confirmFieldTranslationEditDialog"></fieldTranslationEditDialog>
98
+ <!-- <langTagDialog v-if="showLangTagDialog3"
99
+ :visiable.sync="showLangTagDialog3"
100
+ @confirm="confirmLangTagDialog3"
101
+ :rows="checkTags"
102
+ :multi="true"></langTagDialog>-->
103
+ </div>
104
+ </template>
105
+
106
+ <script>
107
+ import fieldTranslationEditDialog from "../../../views/user/fieldTranslation/editDialog.vue";
108
+ import {treeScollx} from '@base/utils/global.js';
109
+ import {getBdFlag} from "@base/api/user";
110
+ import tableForm from "@base/components/table/tableForm.vue";
111
+ /*import langTagDialog from "../../../views/user/lang_tag/dialog.vue";
112
+ import langTagAddButton from "@base/components/langTag/addButton.vue";
113
+ import langTagDeleteButton from "@base/components/langTag/deleteButton.vue";
114
+ import langTagView from "@base/components/langTag/view.vue";*/
115
+
116
+ export default {
117
+ name: 'fieldTranslation:list',
118
+ components: {
119
+ tableForm, fieldTranslationEditDialog/*, langTagView,
120
+ langTagDialog, langTagAddButton, langTagDeleteButton*/
121
+ },
122
+ data() {
123
+ return {
124
+ activeName: 'second',
125
+ dataId: 0,
126
+ showEdit: false,
127
+ vxeOption: {},
128
+ formData: {},
129
+
130
+ defaultProps: {
131
+ label: 'dataTypeName', //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
132
+ children: [],
133
+ isLeaf: 'leaf'
134
+ },
135
+ currentDataType: {},
136
+ dataTypeGroup: "fieldTranslation",
137
+ fieldTranslationDicts: [],
138
+ fieldTranslationDictMap: {},
139
+ showTree: false,
140
+ showFieldTranslationEditDialog: false,
141
+ languageSettings: [],
142
+ addProjectTagOption: {
143
+ url: USER_PREFIX + `/fieldTranslation/saveTag`,
144
+ tableDatas: () => {
145
+ return this.$refs["table-m1"].getCheckboxRecords(true);
146
+ },
147
+ reqData: (tagDatas, tableDatas) => {
148
+ let sids = tableDatas.map(item => item.sid);
149
+ let tagCodes = tagDatas.map(item => item.tagCode);
150
+ let reqData = {
151
+ tagCodes,
152
+ sids
153
+ };
154
+ return reqData;
155
+ },
156
+ callback: () => {
157
+ this.searchEvent()
158
+ }
159
+ },
160
+ deleteProjectTagOption: {
161
+ url: USER_PREFIX + `/fieldTranslation/deleteTag`,
162
+ tableDatas: () => {
163
+ return this.$refs["table-m1"].getCheckboxRecords(true);
164
+ },
165
+ reqData: (tagDatas, tableDatas) => {
166
+ let sids = tableDatas.map(item => item.sid);
167
+ let tagCodes = tagDatas.map(item => item.tagCode);
168
+ let reqData = {
169
+ tagCodes,
170
+ sids
171
+ };
172
+ return reqData;
173
+ },
174
+ callback: () => {
175
+ this.searchEvent()
176
+ }
177
+ },
178
+ showLangTagDialog3: false,
179
+ checkTags: [],
180
+ isDev: true,
181
+
182
+ };
183
+ },
184
+ async mounted() {
185
+ treeScollx({target: this, type: 'default'});
186
+ /*await this.$getBaseDicts({
187
+ code: "fieldTranslation",
188
+ success: ({dicts, dictMap}) => {
189
+ this.fieldTranslationDicts = dicts;
190
+ this.fieldTranslationDictMap = dictMap;
191
+ }
192
+ });*/
193
+ await this.initLanguageSetting();
194
+ // this.getBdEnv();
195
+ this.initTableList();
196
+ },
197
+ methods: {
198
+ initLanguageSetting() {
199
+ return this.$http({
200
+ url: USER_PREFIX + `/language_setting/listPage`,
201
+ method: `post`,
202
+ data: {
203
+ enabled: true
204
+ },
205
+ isLoading: true,
206
+ modalStrictly: true,
207
+ success: res => {
208
+ this.languageSettings = res?.objx?.records || [];
209
+ }
210
+ });
211
+ },
212
+ searchEvent() {
213
+ this.$refs['table-m1'].commitProxy('reload');
214
+ },
215
+ resetEvent() {
216
+ this.formData = {};
217
+ this.$refs['table-m1'].commitProxy('reload');
218
+ },
219
+ openEditDialog(id) {
220
+ this.dataId = !id || typeof id == 'object' ? 0 : id;
221
+ this.activeName = 'first';
222
+ this.$openEditView('showEdit');
223
+ },
224
+ getSearchParam() {
225
+ let tagCodes = null;
226
+ if (this.checkTags.length) {
227
+ tagCodes = this.checkTags.map(item => item.tagCode);
228
+ }
229
+ return {
230
+ ...this.formData,
231
+ dataTypeCode: this.currentDataType.dataTypeCode,
232
+ tagCodes
233
+ };
234
+ },
235
+ initTableList() {
236
+ let that = this;
237
+ let dataTypeMap = {
238
+ "business": this.$t1('全局对照表'),
239
+ "menus": this.$t1('菜单对照表'),
240
+ }
241
+ let syncColumns = []
242
+ this.languageSettings.forEach(item => {
243
+ syncColumns.push({
244
+ title: item.languageName,
245
+ field: item.translationField,
246
+ width: 150
247
+ })
248
+ })
249
+ let tableOption = {
250
+ vue: this,
251
+ tableRef: 'table-m1',
252
+ tableName: 'user_fieldTranslation_list-m1',
253
+ path: USER_PREFIX + '/fieldTranslation/listPage',
254
+ param: () => {
255
+ return this.getSearchParam();
256
+ },
257
+ config: {
258
+ proxyConfig: {
259
+ autoLoad: false
260
+ }
261
+ },
262
+ columns: [
263
+ {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
264
+ {
265
+ title: this.$t1('字段编码'),
266
+ field: 'fieldCode',
267
+ width: 150,
268
+ fixed: 'left'
269
+ },
270
+ {
271
+ title: this.$t1('中文'),
272
+ field: 'translation1',
273
+ width: 150,
274
+ fixed: 'left'
275
+ },
276
+ ...syncColumns,
277
+ {
278
+ title: this.$t1('数据类型'),
279
+ field: 'dataTypeName',
280
+ width: 150,
281
+ slots: {
282
+ default: ({row}) => {
283
+ return dataTypeMap[row.dataTypeCode] || '';
284
+ }
285
+ }
286
+ },
287
+ /*{
288
+ title: this.$t1('多语言标签'), field: 'tag', width: 250, slots: {default: "tag"}, params: {
289
+ exportVal: ({row}) => {
290
+ if (row.fieldTranslationTagDTOs) {
291
+ return row.fieldTranslationTagDTOs.map(item => item.tagName).join(",")
292
+ }
293
+ }
294
+ }
295
+ },*/
296
+ {
297
+ field: 'modifyDate',
298
+ title: this.$t1('更新时间'),
299
+ width: 150
300
+ },
301
+ {
302
+ width: 47,
303
+ fixed: 'right',
304
+ title: '',
305
+ sortable: false,
306
+ slots: {
307
+ default: ({row}) => {
308
+ return [
309
+ <div>
310
+ <a
311
+ href="javascript:void(0);"
312
+ class="a-link"
313
+ onclick={() => {
314
+ this.openFieldTranslationEditDialog(row.id);
315
+ }}
316
+ >
317
+ <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
318
+ popper-class="tooltip-skin">
319
+ <i class="el-icon-edit"/>
320
+ </el-tooltip>
321
+ </a>
322
+ </div>
323
+ ];
324
+ }
325
+ }
326
+ }
327
+ ],
328
+ searchColumns: [
329
+ {
330
+ title: this.$t1('数据类型'),
331
+ field: "dataTypeName",
332
+ type: "input",
333
+ common: true,
334
+ disabled: true,
335
+ defaultValueEnabled: false,
336
+ slot: "dataTypeName"
337
+ },
338
+ {title: this.$t1('字段编码'), field: "fieldCode", type: "input", common: true},
339
+ {title: this.$t1('中文'), field: "translation1", type: "input", common: true},
340
+ // {title: this.$t1('多语言标签'), field: "tag", type: "input", common: true, slot: "tag"},
341
+ ]
342
+ };
343
+ this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
344
+ this.vxeOption = opts;
345
+ this.showTree = true;
346
+ });
347
+ },
348
+ handleNodeClick(data, node, v) {
349
+ this.currentDataType = data;
350
+ this.$forceUpdate();
351
+ this.searchEvent();
352
+ },
353
+ // 异步树叶子节点懒加载逻辑
354
+ loadNode(node, resolve) {
355
+
356
+ let rows = [
357
+ {
358
+ dataTypeName: this.$t1('全局对照表'),
359
+ dataTypeCode: 'business',
360
+ id: 'business',
361
+ leaf: true,
362
+ },
363
+ {
364
+ dataTypeName: this.$t1('菜单对照表'),
365
+ dataTypeCode: 'menus',
366
+ id: 'menus',
367
+ leaf: true,
368
+ }
369
+ ]
370
+ resolve(rows);
371
+ if (rows.length) {
372
+ this.$nextTick(() => {
373
+ let data = node.childNodes[0].data;
374
+ this.$refs.tree.setCurrentKey(data);
375
+ this.currentDataType = data;
376
+ this.searchEvent();
377
+ })
378
+ }
379
+ },
380
+
381
+ openFieldTranslationEditDialog(id) {
382
+ this.dataId = !id || typeof id == 'object' ? 0 : id;
383
+ if (!this.dataId) {
384
+ if (!this.currentDataType) {
385
+ this.$baseAlert(this.$t1('请选择数据类型'));
386
+ return
387
+ }
388
+ }
389
+ this.showFieldTranslationEditDialog = true;
390
+ },
391
+ confirmFieldTranslationEditDialog(row) {
392
+ this.searchEvent();
393
+ },
394
+ importExcel() {
395
+ let that = this;
396
+ let currentDataType = this.currentDataType;
397
+ that.$excelImport({
398
+ title: this.$t1('多语言导入({dataTypeName})', {dataTypeName: currentDataType.dataTypeName}),
399
+ prefix: USER_PREFIX,
400
+ excel: USER_PREFIX + '/excelTemplate/fieldTranslation/fieldTranslation.xlsx',
401
+ multi: false,
402
+ saveUrl: USER_PREFIX + '/fieldTranslation/importData',
403
+ defaultValue: {dataTypeCode: currentDataType.dataTypeCode},
404
+ callback: () => {
405
+ that.searchEvent();
406
+ }
407
+ });
408
+ },
409
+ jsonImport() {
410
+ this.$langImport({
411
+ saveUrl: USER_PREFIX + '/fieldTranslation/import2Publish',
412
+ lang: true,
413
+ callback: () => {
414
+ this.searchEvent();
415
+ }
416
+ });
417
+ },
418
+ jsonExport() {
419
+ this.$baseConfirm(this.$t1('您确定要导出发布吗?'))
420
+ .then(() => {
421
+ this.$http({
422
+ url: USER_PREFIX + "/fieldTranslation/export2Publish",
423
+ method: `post`,
424
+ data: this.getSearchParam(),
425
+ isLoading: true,
426
+ success: res => {
427
+ let content = res.objx
428
+ if (content && content !== "[]") {
429
+ this.downloadTxt(content)
430
+ } else {
431
+ this.$baseAlert(this.$t1('不存在需要导出的数据'))
432
+ }
433
+ }
434
+ });
435
+ })
436
+ .catch(() => {
437
+ });
438
+ },
439
+ downloadTxt(content) {
440
+ // 创建Blob对象
441
+ const blob = new Blob([content], {type: 'text/plain;charset=utf-8'});
442
+ // 创建URL
443
+ const url = URL.createObjectURL(blob);
444
+ // 创建a标签
445
+ const link = document.createElement('a');
446
+ link.href = url;
447
+ link.setAttribute('download', 'fieldTranslation.txt');
448
+ document.body.appendChild(link);
449
+ // 触发下载
450
+ link.click();
451
+ // 清理
452
+ document.body.removeChild(link);
453
+ URL.revokeObjectURL(url);
454
+ },
455
+ openLangTagDialog3() {
456
+ this.showLangTagDialog3 = true;
457
+ },
458
+ confirmLangTagDialog3(rows) {
459
+ this.checkTags = rows;
460
+ },
461
+ getTabNames() {
462
+ return this.checkTags.map(item => item.tagName).join(",");
463
+ },
464
+ getBdEnv() {
465
+ getBdFlag({
466
+ success: res => {
467
+ this.isDev = res.objx == 1
468
+ }
469
+ });
470
+ }
471
+ }
472
+ };
473
+ </script>