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()
};;

View File

@ -19,12 +19,14 @@
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
@chooseData="chooseData">
<template #pxlx="{ row }">
<dictTag :value="row.pxlx" :tag="false" :options="D_PXDG_PXLX" />
</template>
<!-- 操作 -->
<template #controls="{ row }">
<el-link type="primary" link @click="addEdit('edit', row.id)">编辑</el-link>
<el-link type="primary" link @click="addEdit('detail', row.id)">详情</el-link>
<el-link type="danger" link @click="handleDelete(row.id)">删除</el-link>
<el-link type="danger" link @click="handleDelete([row.id])">删除</el-link>
</template>
</MyTable>
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
@ -33,7 +35,7 @@
}"></Pages>
</div>
<!-- 详情 -->
<DetailForm ref="detailDiloag" @refresh="getList" />
<DetailForm ref="detailDiloag" v-if="show" :dic="{D_PXDG_PXLX}" @refresh="getList" />
</div>
</template>
@ -48,10 +50,9 @@ import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
const { proxy } = getCurrentInstance();
const { D_PXDG_PXLX } = proxy.$dict("D_PXDG_PXLX")
const show = ref(false)
const detailDiloag = ref();
const searchBox = ref(); //搜索框
const baseUrl = 'data:image/jpeg;base64,'
const searchConfiger = ref([
{
label: "教学项目",
@ -77,7 +78,7 @@ const pageData = reactive({
},
controlsWidth: 180,
tableColumn: [
{ label: "培训类型", prop: "pxlx", options: D_PXDG_PXLX },
{ label: "培训类型", prop: "pxlx",showSolt: true},
{ label: "教学项目", prop: "jxxm" },
]
});
@ -118,17 +119,18 @@ const getList = () => {
// 删除
const handleDelete = (id) => {
// proxy.$modal.confirm("是否确认删除该值守点?").then(() => {
// qcckPost({ id }, "/mosty-jbld/jbldzsd/delete").then(() => {
// proxy.$modal.msgSuccess("删除成功");
// getList();
// });
// });
const handleDelete = (ids) => {
proxy.$modal.confirm("是否确认删除").then(() => {
qcckPost(ids, "/mosty-base/baxx/jxda/remove").then(() => {
proxy.$modal.msgSuccess("删除成功");
getList();
});
});
};
// 详情
const addEdit = (type, id) => {
show.value = true;
nextTick(() => {
detailDiloag.value.init(type, id);
})