jobsys-newbie 2.0.2 → 2.0.3

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,11 +1,12 @@
1
1
  import { computed, defineComponent, inject, onMounted, reactive, ref, watch } from "vue"
2
2
  import { cloneDeep, every, isEqual, isFunction, isObject, isString, pick } from "lodash-es"
3
- import { useFetch, useFormFail, useFormFormat, useI18nJoin, useProcessStatusSuccess, useT } from "../../hooks"
3
+ import { useFetch, useFormFail, useFormFormat, useI18nJoin, useProcessStatusSuccess } from "../../hooks"
4
4
  import { Button, Card, Form, message, Modal, Skeleton, Space } from "ant-design-vue"
5
5
  import createLayout from "./components/Layout.jsx"
6
6
  import { NEWBIE_UPLOADER, NEWBIE_FORM } from "../provider/NewbieProvider.jsx"
7
7
  import "./index.less"
8
8
  import { initItemDefaultValue } from "./utils"
9
+ import { useI18n } from "vue-i18n"
9
10
 
10
11
  /**
11
12
  * 表单组件
@@ -227,6 +228,8 @@ export default defineComponent({
227
228
  },
228
229
  emits: ["success"],
229
230
  setup(props, { expose, slots, emit }) {
231
+ const { t } = useI18n()
232
+
230
233
  const editorRef = ref(null) //总的容器
231
234
 
232
235
  const state = reactive({
@@ -391,7 +394,7 @@ export default defineComponent({
391
394
  props.afterSubmit(res)
392
395
  } else {
393
396
  useProcessStatusSuccess(res, () => {
394
- message.success(useI18nJoin(props.submitButtonText || useT("common.save"), useT("common.success")))
397
+ message.success(useI18nJoin(props.submitButtonText || t("common.save"), t("common.success")))
395
398
  emit("success", res)
396
399
  })
397
400
  }
@@ -490,7 +493,7 @@ export default defineComponent({
490
493
  }}
491
494
  >
492
495
  {{
493
- default: () => `${props.submitButtonText || useT("common.save")}${state.submitFetcher.loading ? "..." : ""}`,
496
+ default: () => `${props.submitButtonText || t("common.save")}${state.submitFetcher.loading ? "..." : ""}`,
494
497
  }}
495
498
  </Button>
496
499
  )
@@ -504,7 +507,7 @@ export default defineComponent({
504
507
  }
505
508
  }}
506
509
  >
507
- {{ default: () => props.closeButtonText || useT("common.close") }}
510
+ {{ default: () => props.closeButtonText || t("common.close") }}
508
511
  </Button>
509
512
  )
510
513
 
@@ -120,7 +120,7 @@ const render = (item, queryForm, context) => {
120
120
  presets={picker === "date" ? presets.value : []}
121
121
  style={{ width: "200px" }}
122
122
  class={`${searchProvider.inputClass || ""}`}
123
- placeholder={useI18nJoin(useT("search"), item.title)}
123
+ placeholder={useI18nJoin(useT("common.search"), item.title)}
124
124
  getPopupContainer={(triggerNode) => triggerNode?.parentNode}
125
125
  {...item.inputProps}
126
126
  ></DatePicker>
@@ -1095,7 +1095,7 @@ export function useTableActions(actions) {
1095
1095
  }
1096
1096
 
1097
1097
  if (action.action) {
1098
- props.onClick = action.action
1098
+ props.onClick = withModifiers(() => action.action, ["stop"])
1099
1099
  }
1100
1100
  if (action.tooltip) {
1101
1101
  const title = action.tooltip
@@ -1112,10 +1112,10 @@ export function useTableActions(actions) {
1112
1112
  const menuItems = action.children
1113
1113
 
1114
1114
  return (
1115
- <Dropdown placement={"bottom"}>
1115
+ <Dropdown placement={"bottom"} onClick={withModifiers(() => {}, ["stop"])}>
1116
1116
  {{
1117
1117
  default: () => (
1118
- <NewbieButton type={"text"} size={"small"} {...props}>
1118
+ <NewbieButton type={"text"} size={"small"} {...props} onClick={withModifiers(() => {}, ["stop"])}>
1119
1119
  {() => [<DownOutlined style={{ fontSize: "12px" }}></DownOutlined>, name]}
1120
1120
  </NewbieButton>
1121
1121
  ),
@@ -1129,7 +1129,7 @@ export function useTableActions(actions) {
1129
1129
  type={"text"}
1130
1130
  style={{ textAlign: "left" }}
1131
1131
  buttonProps={{ block: true }}
1132
- onClick={item.action}
1132
+ onClick={withModifiers(() => item.action(), ["stop"])}
1133
1133
  {...item.props}
1134
1134
  >
1135
1135
  {() => item.name}