|
@@ -73,7 +73,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="tsx" setup name="LjSelector">
|
|
|
-import { reactive, toRefs, ref, onMounted, nextTick, inject, watch } from "vue";
|
|
|
+import { reactive, toRefs, ref, onMounted, nextTick, inject, watch, computed } from "vue";
|
|
|
import LjDialog from "@/components/LjDialog/index.vue";
|
|
|
import LjFoldLayoutDouble from "@/components/LjFoldLayoutDouble/index.vue";
|
|
|
// import LjVxeTable from "@/components/LjVxeTable/index.vue";
|
|
@@ -92,6 +92,7 @@ import SalePriceItem from "./components/SalePriceItem.vue";
|
|
|
import draggable from "vuedraggable";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import { isArray, isBoolean } from "@/utils/is";
|
|
|
+import { t } from "@/utils/i18n";
|
|
|
|
|
|
interface LjDialogSelectorProps {
|
|
|
/**
|
|
@@ -125,14 +126,17 @@ interface LjDialogSelectorProps {
|
|
|
*/
|
|
|
beforeSubmit?: (params?: any) => boolean;
|
|
|
layout?: any;
|
|
|
+ submitText?: string;
|
|
|
}
|
|
|
|
|
|
+// const { t } = useI18n();
|
|
|
+
|
|
|
const props = withDefaults(defineProps<LjDialogSelectorProps>(), {
|
|
|
- multipleLimit: 1
|
|
|
+ multipleLimit: 1,
|
|
|
+ submitText: t("common.table.submit")
|
|
|
// action: () => []
|
|
|
});
|
|
|
|
|
|
-const { t } = useI18n();
|
|
|
const { CheckPower, funcFilterPower, funcRightActionPower, buttonDefault } = useAuthButtons(t);
|
|
|
const LjSelectorRef = ref();
|
|
|
|
|
@@ -210,17 +214,6 @@ const funcCancel = () => {
|
|
|
dialogVisible.value = false;
|
|
|
};
|
|
|
|
|
|
-const defaultAction: detailAction[] = [
|
|
|
- buttonDefault({
|
|
|
- label: t("common.table.submit"),
|
|
|
- clickFunc: () => funcSubmit()
|
|
|
- }),
|
|
|
- buttonDefault({
|
|
|
- label: t("common.cancelText"),
|
|
|
- clickFunc: () => funcCancel()
|
|
|
- })
|
|
|
-];
|
|
|
-
|
|
|
const btnGroup = ref<any>([]);
|
|
|
|
|
|
const initParams = ref<any>();
|
|
@@ -235,13 +228,22 @@ const dialogVisible = ref(false);
|
|
|
*/
|
|
|
const show = (params: any, activeName?: string, refresh?: boolean) => {
|
|
|
initParams.value = params;
|
|
|
- btnGroup.value = defaultAction.concat(funcFilterPower(props.action));
|
|
|
- console.log("btnGroup.value :>> ", btnGroup.value);
|
|
|
|
|
|
activeName && (activeCollapse.value = activeName);
|
|
|
|
|
|
LjSelectorRef.value.show(refresh);
|
|
|
nextTick(() => {
|
|
|
+ let defaultAction: detailAction[] = [
|
|
|
+ buttonDefault({
|
|
|
+ label: props.submitText,
|
|
|
+ clickFunc: () => funcSubmit()
|
|
|
+ }),
|
|
|
+ buttonDefault({
|
|
|
+ label: t("common.cancelText"),
|
|
|
+ clickFunc: () => funcCancel()
|
|
|
+ })
|
|
|
+ ];
|
|
|
+ btnGroup.value = defaultAction.concat(funcFilterPower(props.action));
|
|
|
dialogVisible.value = true;
|
|
|
});
|
|
|
};
|