This commit is contained in:
2025-09-24 19:26:59 +08:00
parent c6a0f0b9aa
commit 449b3c9916
5 changed files with 62 additions and 60 deletions

View File

@ -19,6 +19,12 @@ import { qcckPost , qcckGet} from "@/api/qcckApi.js";
import FormMessage from "@/components/aboutTable/FormMessage.vue";
import { ref, reactive,defineEmits,getCurrentInstance } from 'vue';
const emit = defineEmits(["refresh"]);
const props = defineProps({
dic: {
type: Object,
default: () => {}
}
})
const { proxy } = getCurrentInstance();
const dialogForm = ref(false);
const title = ref('');
@ -27,25 +33,23 @@ const loading = ref(false);
const listQuery = ref({});
const openType = ref("")
const { D_PXDG_PXLX } = proxy.$dict("D_PXDG_PXLX")
const rules = reactive({
pxlx: [{ required: true, message: "请输入视频标题", trigger: "blur" }],
});
const formList = reactive([
[
{ label: "培训类型", prop: "pxlx", type: "select", options: D_PXDG_PXLX },
{ label: "培训类型", prop: "pxlx", type: "select", options: props.dic.D_PXDG_PXLX },
{ label: "教学项目", prop: "jxxm", type: "input" },
],
[
{ label: "教学内容", prop: "jxnr", type: "input" },
{ label: "教学内容", prop: "dgnr", type: "input" },
{ label: "教学目标", prop: "jxmb", type: "input" },
],
[
{ label: "学时安排", prop: "xsap", type: "input" },
{ label: "学时安排", prop: "gksc", type: "number" },
],
[
{ label: "上传附件", prop: "fjdz", type: "upload" },
{ label: "上传附件", prop: "fj", type: "upload" },
],
])
@ -58,22 +62,29 @@ const init = (type, id,) => {
if(id) getDateById(id)
};
function getDateById (id) {
qcckPost({},`/mosty-base/baxx/jxda/getInfo/${id}`).then((res) => {
listQuery.value = res || {};
})
}
const save = () => {
FormRef.value.submit(()=>{
// loading.value = true;
// let url = title.value == '新增' ? `/mosty-jbld/jbldzsd/add` : `/mosty-jbld/jbldzsd/update`;
// qcckPost(listQuery.value, url).then(() => {
// loading.value = false;
loading.value = true;
let url = title.value == '新增' ? `/mosty-base/baxx/jxda/add` : `/mosty-base/baxx/jxda/edit`;
qcckPost(listQuery.value, url).then(() => {
loading.value = false;
proxy.$message.success("保存成功");
// emit("refresh");
emit("refresh");
close();
// }).catch(() => {
// loading.value = false;
// })
}).catch(() => {
loading.value = false;
})
});
}
const close = () => {
dialogForm.value = false;
listQuery.value = {fj:''}
FormRef.value.reset()
};;