修改作业流程
This commit is contained in:
parent
fb5948f290
commit
9cf96035d8
|
@ -46,6 +46,14 @@ const stuzy: AppRouteModule = {
|
|||
},
|
||||
component: () => import('/@/views/kc/zyJxdgBanben/ZyJxdgStudentList.vue'),
|
||||
},
|
||||
{
|
||||
path: 'studentKczy',
|
||||
name: 'studentKczy',
|
||||
meta: {
|
||||
title: '课程资源',
|
||||
},
|
||||
component: () => import('/@/views/zy/zyZyxx/ZyZyxxStudentList.vue'),
|
||||
},
|
||||
{
|
||||
path: 'studentLszy',
|
||||
name: 'studentLszy',
|
||||
|
|
|
@ -135,6 +135,14 @@ const zuoye: AppRouteModule = {
|
|||
title: '教学大纲',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dqkcKczy',
|
||||
name: 'dqkcKczy',
|
||||
component: () => import('/@/views/zy/zyZyxx/ZyZyxxList.vue'),
|
||||
meta: {
|
||||
title: '教学大纲',
|
||||
},
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1329,7 +1329,6 @@ function handleZycs() {
|
|||
score: '',
|
||||
rwbh: rwbh,
|
||||
xqxn: xqxn,
|
||||
createBy: teano,
|
||||
atype: wjLeixing.value,
|
||||
});
|
||||
}
|
||||
|
@ -1363,7 +1362,7 @@ function handleDelZycs(index) {
|
|||
|
||||
function handleSzzycs(val){
|
||||
|
||||
defHttp.get({ url: '/zyInfo/zyInfo/zyzb', params: { rwbh, xqxn, teano, zyLeixing: '1' } }).then((res) => {
|
||||
defHttp.get({ url: '/zyInfo/zyInfo/zyzb', params: { rwbh, xqxn, zyLeixing: '1' } }).then((res) => {
|
||||
console.log('😥', res);
|
||||
var list = res;
|
||||
for(var i = 0; i < list.length; i++){
|
||||
|
|
|
@ -9,8 +9,10 @@
|
|||
<a-spin :spinning="confirmLoading" v-if="showType == 1">
|
||||
<a-row style="min-height: calc(80vh); background: #fcfcfc">
|
||||
<a-col :span="24" style="overflow-y: scroll">
|
||||
<div style="text-align: center; width: 100%; font-weight: bold; font-size: 20px"> {{ title }}</div>
|
||||
<div style="text-align: center; width: 100%; font-weight: bold; font-size: 20px;margin-top: 50px;margin-bottom: 40px;"> {{ title }}</div>
|
||||
<div style="text-align: center; width: 100%; font-weight: bold; font-size: 20px;color:red;" v-if="sfsxs"> 您不是此测验的学生,不能进行提交</div>
|
||||
|
||||
<div style=" width: 100%;margin-left: 30px;" v-html="content"></div>
|
||||
<!-- 题干信息 -->
|
||||
<div style="width: 100%; padding: 0 40px; margin: 0 auto" v-for="(item, index) in tiganData" :key="index">
|
||||
<!-- 单选题 -->
|
||||
|
@ -151,6 +153,7 @@ import headerPage from '/@/views/site/common/header.vue';
|
|||
import footerPage from '/@/views/site/common/footer.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const content = ref<string>('');
|
||||
const mainId = ref<string>('');
|
||||
const isShow = ref<boolean>(false);
|
||||
const disabled = ref<boolean>(false);
|
||||
|
@ -268,6 +271,13 @@ onMounted(() => {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
defHttp.get({ url: '/wjxWjxx/wjxWjxx/queryById', params: { id: cyid } }).then((res) => {
|
||||
console.log('🎅11111111', res);
|
||||
content.value = res.content
|
||||
|
||||
});
|
||||
|
||||
defHttp.get({ url: '/wjxWjxx/wjxWjxx/getSfxs', params: { id: cyid } }).then((res) => {
|
||||
console.log('🙂', res);
|
||||
var num = res.num;
|
||||
|
@ -298,12 +308,10 @@ defineExpose({
|
|||
color: rgba(0, 0, 0, 0.85);
|
||||
font-size: 14px;
|
||||
font-variant: tabular-nums;
|
||||
line-height: 1.5715;
|
||||
list-style: none;
|
||||
font-feature-settings: tnum;
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
line-height: unset;
|
||||
cursor: pointer;
|
||||
width: 80%;
|
||||
}
|
||||
|
@ -332,18 +340,15 @@ defineExpose({
|
|||
background: #1ab394;
|
||||
}
|
||||
.ant-layout-footer {
|
||||
line-height: 1.5;
|
||||
background: #fff;
|
||||
}
|
||||
.ant-layout-sider {
|
||||
color: #fff;
|
||||
line-height: 120px;
|
||||
background: #3ba0e9;
|
||||
}
|
||||
.ant-layout-content {
|
||||
min-height: 120px;
|
||||
color: #000;
|
||||
line-height: 120px;
|
||||
background: #f3f3f4;
|
||||
}
|
||||
.dictBox :deep(.ant-select) {
|
||||
|
|
|
@ -320,7 +320,7 @@ function cjwtData() {
|
|||
defHttp
|
||||
.get({
|
||||
url: '/zyCjwt/zyCjwt/list',
|
||||
params: { pageSize: 3, pageNo: current.value, rwbh: rwbh, xqxn: xqxn, teano: teano, column: 'createTime', order: 'desc' },
|
||||
params: { pageSize: 3, pageNo: current.value, rwbh: rwbh, xqxn: xqxn, column: 'createTime', order: 'desc' },
|
||||
})
|
||||
.then((res) => {
|
||||
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
|
||||
|
@ -334,7 +334,7 @@ function cjwtData() {
|
|||
//获取课程简介和教学大纲内容
|
||||
function getKcjsJxdg() {
|
||||
console.log(`🚀 ~111111111111111:`);
|
||||
defHttp.get({ url: '/zyJxdg/zyJxdg/getKcjsJxdg', params: { rwbh: rwbh, xqxn: xqxn, teano: teano } }).then((res) => {
|
||||
defHttp.get({ url: '/zyJxdg/zyJxdg/getKcjsJxdg', params: { rwbh: rwbh, xqxn: xqxn, } }).then((res) => {
|
||||
console.log(`🚀 ~2222222222222222:`, res);
|
||||
if (res) {
|
||||
jxdgInfo.value = res;
|
||||
|
@ -346,7 +346,6 @@ function addKcjsHandle(type) {
|
|||
var model = jxdgInfo.value;
|
||||
model.rwbh = rwbh;
|
||||
model.xqxn = xqxn;
|
||||
model.teano = teano;
|
||||
console.log(`🚀 ~ addKcjsHandle ~ model:`, model);
|
||||
if (model.id) {
|
||||
if (type == '1') {
|
||||
|
|
|
@ -45,6 +45,10 @@
|
|||
</template>
|
||||
<span @click="getGzt('kcjc')">课堂测验</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="sub6">
|
||||
<BlockOutlined />
|
||||
<span @click="getGzt('kczy')">课程资源</span>
|
||||
</a-menu-item>
|
||||
<!-- <a-menu-item key="sub6">
|
||||
<template #icon>
|
||||
<BlockOutlined />
|
||||
|
@ -103,6 +107,9 @@
|
|||
<a-menu-item key="sub5">
|
||||
<span @click="getGzt('kcjc')">课堂测验</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="sub6">
|
||||
<span @click="getGzt('kczy')">课程资源</span>
|
||||
</a-menu-item>
|
||||
<!-- <a-menu-item key="sub5">
|
||||
<span @click="getGzt('gongju')">AI识别出勤率</span>
|
||||
</a-menu-item> -->
|
||||
|
@ -180,6 +187,8 @@ function getGzt(zytype) {
|
|||
href = '/zy/dqkcQmzy';
|
||||
}else if (zytype == 'jxdg') {
|
||||
href = '/zy/dqkcJxdg';
|
||||
}else if (zytype == 'kczy') {
|
||||
href = '/zy/dqkcKczy';
|
||||
}
|
||||
|
||||
router.push({ path: href, query: { rwbh, xqxn, type, teano } });
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
</template>
|
||||
<span @click="getGzt('kcjs')">课程简介</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="sub3">
|
||||
<!-- <a-menu-item key="sub3">
|
||||
<template #icon>
|
||||
<SettingOutlined />
|
||||
</template>
|
||||
<span @click="getGzt('jxdg')">教学大纲</span>
|
||||
</a-menu-item>
|
||||
</a-menu-item> -->
|
||||
<a-menu-item key="sub4">
|
||||
<template #icon>
|
||||
<SnippetsOutlined />
|
||||
|
@ -45,6 +45,12 @@
|
|||
</template>
|
||||
<span @click="getGzt('kcjc')">课程测验</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="sub8">
|
||||
<template #icon>
|
||||
<BlockOutlined />
|
||||
</template>
|
||||
<span @click="getGzt('kczy')">课程资源</span>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-col>
|
||||
<a-col :lg="0" :xs="{ span: 24 }" style="text-align: right;">
|
||||
|
@ -75,6 +81,9 @@
|
|||
<a-menu-item key="min5">
|
||||
<span @click="getGzt('kcjc')">课程测验</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="min8">
|
||||
<span @click="getGzt('kczy')">课程资源</span>
|
||||
</a-menu-item>
|
||||
<!-- <a-menu-item key="min6">
|
||||
<span @click="getGzt('dcwj')">问卷调查</span>
|
||||
</a-menu-item>
|
||||
|
@ -99,7 +108,7 @@
|
|||
import headerPage from '/@/views/site/common/header.vue';
|
||||
import footerPage from '/@/views/site/common/footer.vue';
|
||||
import dqxqkc from '/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkc.vue';
|
||||
import { MailOutlined, AppstoreOutlined, SettingOutlined, MenuUnfoldOutlined,PieChartOutlined,BarChartOutlined,SnippetsOutlined,AppstoreAddOutlined } from '@ant-design/icons-vue';
|
||||
import { MailOutlined, AppstoreOutlined, SettingOutlined, MenuUnfoldOutlined,PieChartOutlined,BarChartOutlined,SnippetsOutlined,AppstoreAddOutlined,BlockOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
|
||||
const maxClassName = ref<any>({});
|
||||
|
@ -137,8 +146,11 @@ import { MailOutlined, AppstoreOutlined, SettingOutlined, MenuUnfoldOutlined,Pie
|
|||
href = "/stuzy/studentQmks";
|
||||
}else if(zytype=='jxdg'){//jxdg
|
||||
href = "/stuzy/studentJxdg";
|
||||
}else if(zytype=='kczy'){//kczy
|
||||
href = "/stuzy/studentKczy";
|
||||
}
|
||||
|
||||
|
||||
router.push({path:href,query: {rwbh,xqxn,type,teano}});
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
const { rwbh,xqxn } = query;//获取传递参数
|
||||
const userStore = useUserStore();
|
||||
const userName = userStore.getUserInfo.username;
|
||||
const queryParam = ref<any>({rwbh, xqxn,"createBy":userName});
|
||||
const queryParam = ref<any>({rwbh, xqxn});
|
||||
const registerModal = ref();
|
||||
const registerYlModal = ref();
|
||||
// const registerHistoryModal = ref();
|
||||
|
|
|
@ -328,7 +328,8 @@ function handleShangchuan(record) {
|
|||
}
|
||||
|
||||
ZyInfoStudentModalPage.value.disableSubmit = false;
|
||||
var param = { id: record.stuId, zyfj: record.filePath };
|
||||
var param = { id: record.id,stuId:record.stuId, zyfj: record.filePath };
|
||||
console.log('------->',param);
|
||||
ZyInfoStudentModalPage.value.edit(param);
|
||||
}
|
||||
|
||||
|
|
|
@ -1596,7 +1596,7 @@ function reloadZy() {
|
|||
queryParamZy.value.pageSize = pageSize.value;
|
||||
queryParamZy.value.rwbh = rwbh;
|
||||
queryParamZy.value.xnxq = xqxn;
|
||||
queryParamZy.value.teano = teano;
|
||||
// queryParamZy.value.teano = teano;
|
||||
queryParamZy.value.zyLeixing = '1';
|
||||
// queryParamZy.value.column = 'a.sort';
|
||||
// queryParamZy.value.order = 'asc';
|
||||
|
|
|
@ -587,7 +587,7 @@ import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
|
|||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { newcolumns } from '/@/views/zy/zyInfoStudent/ZyInfoStudent.data';
|
||||
import { newlist, getExportUrl, batchFabu, batchKhcl } from '/@/views/zy/zyInfoStudent/ZyInfoStudent.api';
|
||||
import { getList2, getExportUrl, batchFabu, batchKhcl } from '/@/views/zy/zyInfoStudent/ZyInfoStudent.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { useGlobSetting } from '/@/hooks/setting';
|
||||
|
@ -657,7 +657,7 @@ const pdfUrl = ref('/downPath/ylhpsf.pdf');
|
|||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
api: newlist,
|
||||
api: getList2,
|
||||
columns: newcolumns,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
|
@ -1550,7 +1550,8 @@ function handleZyxx(record, type) {
|
|||
selectedRowKeys.value = [];
|
||||
console.log('🧟♀️', rowSelection);
|
||||
queryParam.value = {};
|
||||
queryParam.value.mainId = record.id;
|
||||
queryParam.value.ywid = record.id;
|
||||
queryParam.value.rwbh = rwbh;
|
||||
queryParam.value.queryType = type;
|
||||
reload();
|
||||
}
|
||||
|
@ -1648,7 +1649,7 @@ function reloadZy() {
|
|||
queryParamZy.value.pageSize = pageSize.value;
|
||||
queryParamZy.value.rwbh = rwbh;
|
||||
queryParamZy.value.xnxq = xqxn;
|
||||
queryParamZy.value.teano = teano;
|
||||
// queryParamZy.value.teano = teano;
|
||||
queryParamZy.value.zyLeixing = '0';
|
||||
// queryParamZy.value.column = 'a.sort';
|
||||
// queryParamZy.value.order = 'asc';
|
||||
|
|
|
@ -5,6 +5,7 @@ const { createConfirm } = useMessage();
|
|||
|
||||
enum Api {
|
||||
list = '/zyInfoStudent/zyInfoStudent/list',
|
||||
getList2 = '/zyInfoStudent/zyInfoStudent/getList2',
|
||||
stuList = '/zyInfo/zyInfo/stuList',
|
||||
cdxxlist = '/zyInfoStudent/zyInfoStudent/cdxxlist',
|
||||
stuKccyList = '/wjxWjxx/wjxWjxx/stuList',
|
||||
|
@ -39,6 +40,7 @@ export const getImportUrl = Api.importExcel;
|
|||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
export const newlist = (params) => defHttp.get({ url: Api.list, params });
|
||||
export const getList2 = (params) => defHttp.get({ url: Api.getList2, params });
|
||||
export const stuList = (params) => defHttp.get({ url: Api.stuList, params });
|
||||
export const stuKccyList = (params) => defHttp.get({ url: Api.stuKccyList, params });
|
||||
export const cdxxlist = (params) => defHttp.get({ url: Api.cdxxlist, params });
|
||||
|
|
|
@ -147,6 +147,7 @@
|
|||
});
|
||||
const formRef = ref();
|
||||
const isYl = ref<boolean>(false);
|
||||
const stuId = ref<string>('');
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok','closeLoading']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
|
@ -251,6 +252,7 @@ function handleKcnr(kcnr) {
|
|||
*/
|
||||
function edit(record) {
|
||||
console.log(`🚀 ~ edit ~ record:`, record)
|
||||
stuId.value = record.stuId;
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
|
||||
|
@ -260,7 +262,7 @@ function handleKcnr(kcnr) {
|
|||
zyInfo.value = res;
|
||||
console.log(`🚀 ~ defHttp.get ~ zyInfo:`, zyInfo)
|
||||
|
||||
handleKcnr(zyInfo.value.kcnr)
|
||||
// handleKcnr(zyInfo.value.kcnr)
|
||||
});
|
||||
|
||||
|
||||
|
@ -308,6 +310,8 @@ function handleKcnr(kcnr) {
|
|||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
model.stuId = stuId.value;
|
||||
model.mainId = zyInfo.value.id;
|
||||
zyscStu(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
console.log(`🚀 ~ .then ~ res:`, res)
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/zyZyxx/zyZyxx/list',
|
||||
save='/zyZyxx/zyZyxx/add',
|
||||
edit='/zyZyxx/zyZyxx/edit',
|
||||
deleteOne = '/zyZyxx/zyZyxx/delete',
|
||||
deleteBatch = '/zyZyxx/zyZyxx/deleteBatch',
|
||||
importExcel = '/zyZyxx/zyZyxx/importExcel',
|
||||
exportXls = '/zyZyxx/zyZyxx/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '标题',
|
||||
align: "center",
|
||||
dataIndex: 'title'
|
||||
},
|
||||
{
|
||||
title: '内容',
|
||||
align: "center",
|
||||
dataIndex: 'content'
|
||||
},
|
||||
{
|
||||
title: '资源',
|
||||
align: "center",
|
||||
dataIndex: 'filePath',
|
||||
slots: { customRender: 'fileSlot' },
|
||||
},
|
||||
{
|
||||
title: '是否发布',
|
||||
align: "center",
|
||||
dataIndex: 'sffb_dictText'
|
||||
},
|
||||
];
|
||||
|
||||
//列表数据
|
||||
export const columns2: BasicColumn[] = [
|
||||
{
|
||||
title: '标题',
|
||||
align: "center",
|
||||
dataIndex: 'title'
|
||||
},
|
||||
{
|
||||
title: '内容',
|
||||
align: "center",
|
||||
dataIndex: 'content'
|
||||
},
|
||||
{
|
||||
title: '资源',
|
||||
align: "center",
|
||||
dataIndex: 'filePath',
|
||||
slots: { customRender: 'fileSlot' },
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: "标题",
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "是否发布",
|
||||
field: 'sffb',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "yn"
|
||||
},
|
||||
colProps: {span: 6},
|
||||
},
|
||||
];
|
||||
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '标题',
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入标题!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '内容',
|
||||
field: 'content',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
{
|
||||
label: '附件',
|
||||
field: 'filePath',
|
||||
component: 'JUpload',
|
||||
componentProps:{
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '是否发布',
|
||||
field: 'sffb',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "yn"
|
||||
},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
|
@ -0,0 +1,397 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="标题">
|
||||
<j-input placeholder="请输入标题" v-model:value="queryParam.title"></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="是否发布">
|
||||
<j-dict-select-tag placeholder="请选择是否发布" v-model:value="queryParam.sffb" dictCode="yn"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined" style="margin-left: 8px"> 新增</a-button>
|
||||
<!--<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
|
||||
</a>-->
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template #htmlSlot="{text}">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<!--省市区字段回显插槽-->
|
||||
<!--<template #pcaSlot="{text}">
|
||||
{{ getAreaTextByCode(text) }}
|
||||
</template>-->
|
||||
<template #fileSlot="{text}">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" size="small" @click="downloadFile(text)">下载</a-button>
|
||||
<a-button v-if="text" type="primary" size="small" @click="handlePreview(text)" style="margin-left: 10px;">预览</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
|
||||
<a-modal
|
||||
title="视频播放"
|
||||
:width="800"
|
||||
:visible="videoOpen"
|
||||
:maskClosable="false"
|
||||
:okButtonProps="{ class: { 'jee-hidden': true } }"
|
||||
@cancel="videoHandleCancel"
|
||||
cancelText="关闭"
|
||||
>
|
||||
<div style="text-align: center;width:100%;">
|
||||
<video
|
||||
style="text-align: center;"
|
||||
ref="videoPlayer"
|
||||
:controls="controls"
|
||||
:autoplay="autoplay"
|
||||
:loop="loop"
|
||||
:src="videoUrl"
|
||||
@loadedmetadata="playVideoInFullscreen"
|
||||
>
|
||||
<!-- <source type="video/mp4" /> -->
|
||||
<!-- Your browser does not support the video tag. -->
|
||||
</video>
|
||||
|
||||
<!-- <button @click="playVideo">开始播放</button>
|
||||
<button @click="pauseVideo">停止播放</button> -->
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 表单区域 -->
|
||||
<ZyZyxxModal ref="registerModal" @success="handleSuccess"></ZyZyxxModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="zyZyxx-zyZyxx" setup>
|
||||
import { ref, reactive,onMounted,onUnmounted,unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './ZyZyxx.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyZyxx.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ZyZyxxModal from './components/ZyZyxxModal.vue'
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { useGlobSetting } from '/@/hooks/setting';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { encryptByBase64 } from '/@/utils/cipher';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { JInput } from '/@/components/Form';
|
||||
|
||||
//当前路由信息
|
||||
const { currentRoute } = useRouter();
|
||||
const { query } = unref(currentRoute);
|
||||
const { rwbh, xqxn, type, teano } = query; //获取传递参数
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
const queryParam = ref<any>({rwbh});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const globSetting = useGlobSetting();
|
||||
const baseApiUrl = globSetting.domainUrl;
|
||||
|
||||
|
||||
const videoPlayer = ref(null);
|
||||
const videoOpen = ref<boolean>(false);
|
||||
const controls = ref(true);
|
||||
const autoplay = ref(false)
|
||||
const loop = ref(false);
|
||||
const videoUrl = ref<String>('');
|
||||
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 170,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params.column = '',params.order = '';//新生成的默认不带排序
|
||||
return Object.assign(params, queryParam.value);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "资源信息",
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 7 },
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
});
|
||||
|
||||
// --------------------------视频------------------------------
|
||||
const playVideo = () => {
|
||||
videoPlayer.value.play();
|
||||
};
|
||||
|
||||
const pauseVideo = () => {
|
||||
videoPlayer.value.pause();
|
||||
};
|
||||
const handleFullScreenChange = () => {
|
||||
if (!document.fullscreenElement) {
|
||||
console.log('Video exited fullscreen');
|
||||
// 这里可以执行取消全屏后的逻辑
|
||||
videoOpen.value = false;
|
||||
videoPlayer.value.pause();
|
||||
}
|
||||
};
|
||||
|
||||
function videoHandleCancel(){
|
||||
pauseVideo();
|
||||
videoOpen.value = false;
|
||||
}
|
||||
onMounted(() => {
|
||||
document.addEventListener('fullscreenchange', handleFullScreenChange);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('fullscreenchange', handleFullScreenChange);
|
||||
});
|
||||
|
||||
//视频预览
|
||||
function handleVideo(three){
|
||||
let url = getFileAccessHttpUrl(three.filePath);
|
||||
console.log('视频预览-----》',url);
|
||||
videoOpen.value = true;
|
||||
videoUrl.value = url;
|
||||
playVideoInFullscreen();
|
||||
setTimeout(() => {
|
||||
playVideo();
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
||||
// --------------------------视频------------------------------
|
||||
const playVideoInFullscreen = async () => {
|
||||
if (videoPlayer.value) {
|
||||
try {
|
||||
// 使用原生DOM方法请求全屏
|
||||
await videoPlayer.value.requestFullscreen();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
//预览
|
||||
function handlePreview(record) {
|
||||
const parts = record.split('.');
|
||||
const filetype = parts[parts.length - 1];
|
||||
if(filetype=='jpg' || filetype=='png' || filetype=='jpeg' || filetype=='xls' || filetype=='xlsx' || filetype=='text' ){
|
||||
var file = baseApiUrl + "/"+record;
|
||||
console.log('🤬', file);
|
||||
window.open('https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file)));
|
||||
}else if(filetype=='doc' || filetype=='docx' || filetype=='pdf'){
|
||||
var url2 = getFileAccessHttpUrl(record);
|
||||
let url = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(url2);
|
||||
window.open(url, '_blank');
|
||||
}else if(filetype=='mp4' || filetype=='mp3'){
|
||||
|
||||
let url = getFileAccessHttpUrl(record);
|
||||
console.log('视频预览-----》',url);
|
||||
videoOpen.value = true;
|
||||
videoUrl.value = url;
|
||||
playVideoInFullscreen();
|
||||
setTimeout(() => {
|
||||
playVideo();
|
||||
}, 1000);
|
||||
}
|
||||
else{
|
||||
createMessage.error('暂不支持该文件预览!');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
function handleFabu(record: Recordable) {
|
||||
defHttp.post({ url: '/zyZyxx/zyZyxx/edit', params: { id: record.id,sffb:'1' } }).then(res => {
|
||||
handleSuccess();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function handleChehui(record: Recordable) {
|
||||
defHttp.post({ url: '/zyZyxx/zyZyxx/edit', params: { id: record.id,sffb:'0' } }).then(res => {
|
||||
handleSuccess();
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
if(record.sffb == '0'){
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '发布',
|
||||
onClick: handleFabu.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
}
|
||||
}
|
||||
];
|
||||
}else{
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '撤回',
|
||||
onClick: handleChehui.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
queryParam.value = {};
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
width: calc(50% - 15px);
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,388 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="标题">
|
||||
<a-input placeholder="请输入标题" v-model:value="queryParam.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template #htmlSlot="{text}">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<!--省市区字段回显插槽-->
|
||||
<!--<template #pcaSlot="{text}">
|
||||
{{ getAreaTextByCode(text) }}
|
||||
</template>-->
|
||||
<template #fileSlot="{text}">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" size="small" @click="downloadFile(text)">下载</a-button>
|
||||
<a-button v-if="text" type="primary" size="small" @click="handlePreview(text)" style="margin-left: 10px;">预览</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
|
||||
<a-modal
|
||||
title="视频播放"
|
||||
:width="800"
|
||||
:visible="videoOpen"
|
||||
:maskClosable="false"
|
||||
:okButtonProps="{ class: { 'jee-hidden': true } }"
|
||||
@cancel="videoHandleCancel"
|
||||
cancelText="关闭"
|
||||
>
|
||||
<div style="text-align: center;width:100%;">
|
||||
<video
|
||||
style="text-align: center;"
|
||||
ref="videoPlayer"
|
||||
:controls="controls"
|
||||
:autoplay="autoplay"
|
||||
:loop="loop"
|
||||
:src="videoUrl"
|
||||
@loadedmetadata="playVideoInFullscreen"
|
||||
>
|
||||
<!-- <source type="video/mp4" /> -->
|
||||
<!-- Your browser does not support the video tag. -->
|
||||
</video>
|
||||
|
||||
<!-- <button @click="playVideo">开始播放</button>
|
||||
<button @click="pauseVideo">停止播放</button> -->
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 表单区域 -->
|
||||
<ZyZyxxModal ref="registerModal" @success="handleSuccess"></ZyZyxxModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="zyZyxx-zyZyxx" setup>
|
||||
import { ref, reactive,onMounted,onUnmounted,unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns2 } from './ZyZyxx.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyZyxx.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ZyZyxxModal from './components/ZyZyxxModal.vue'
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { useGlobSetting } from '/@/hooks/setting';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { encryptByBase64 } from '/@/utils/cipher';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
//当前路由信息
|
||||
const { currentRoute } = useRouter();
|
||||
const { query } = unref(currentRoute);
|
||||
const { rwbh, xqxn, type, teano } = query; //获取传递参数
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
const queryParam = ref<any>({rwbh,sffb:'1'});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const globSetting = useGlobSetting();
|
||||
const baseApiUrl = globSetting.domainUrl;
|
||||
|
||||
|
||||
const videoPlayer = ref(null);
|
||||
const videoOpen = ref<boolean>(false);
|
||||
const controls = ref(true);
|
||||
const autoplay = ref(false)
|
||||
const loop = ref(false);
|
||||
const videoUrl = ref<String>('');
|
||||
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
api: list,
|
||||
columns:columns2,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
showActionColumn: false,
|
||||
actionColumn: {
|
||||
width: 170,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params.column = '',params.order = '';//新生成的默认不带排序
|
||||
return Object.assign(params, queryParam.value);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "资源信息",
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 7 },
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
});
|
||||
|
||||
// --------------------------视频------------------------------
|
||||
const playVideo = () => {
|
||||
videoPlayer.value.play();
|
||||
};
|
||||
|
||||
const pauseVideo = () => {
|
||||
videoPlayer.value.pause();
|
||||
};
|
||||
const handleFullScreenChange = () => {
|
||||
if (!document.fullscreenElement) {
|
||||
console.log('Video exited fullscreen');
|
||||
// 这里可以执行取消全屏后的逻辑
|
||||
videoOpen.value = false;
|
||||
videoPlayer.value.pause();
|
||||
}
|
||||
};
|
||||
|
||||
function videoHandleCancel(){
|
||||
pauseVideo();
|
||||
videoOpen.value = false;
|
||||
}
|
||||
onMounted(() => {
|
||||
document.addEventListener('fullscreenchange', handleFullScreenChange);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('fullscreenchange', handleFullScreenChange);
|
||||
});
|
||||
|
||||
//视频预览
|
||||
function handleVideo(three){
|
||||
let url = getFileAccessHttpUrl(three.filePath);
|
||||
console.log('视频预览-----》',url);
|
||||
videoOpen.value = true;
|
||||
videoUrl.value = url;
|
||||
playVideoInFullscreen();
|
||||
setTimeout(() => {
|
||||
playVideo();
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
||||
// --------------------------视频------------------------------
|
||||
const playVideoInFullscreen = async () => {
|
||||
if (videoPlayer.value) {
|
||||
try {
|
||||
// 使用原生DOM方法请求全屏
|
||||
await videoPlayer.value.requestFullscreen();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
//预览
|
||||
function handlePreview(record) {
|
||||
console.log('预览', record);
|
||||
const parts = record.split('.');
|
||||
const filetype = parts[parts.length - 1];
|
||||
if(filetype=='jpg' || filetype=='png' || filetype=='jpeg' || filetype=='xls' || filetype=='xlsx' || filetype=='text' ){
|
||||
var file = baseApiUrl + "/"+record;
|
||||
console.log('🤬', file);
|
||||
window.open('https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file)));
|
||||
}else if(filetype=='doc' || filetype=='docx' || filetype=='pdf'){
|
||||
var url2 = getFileAccessHttpUrl(record);
|
||||
let url = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(url2);
|
||||
window.open(url, '_blank');
|
||||
}else if(filetype=='mp4' || filetype=='mp3'){
|
||||
|
||||
let url = getFileAccessHttpUrl(record);
|
||||
console.log('视频预览-----》',url);
|
||||
videoOpen.value = true;
|
||||
videoUrl.value = url;
|
||||
playVideoInFullscreen();
|
||||
setTimeout(() => {
|
||||
playVideo();
|
||||
}, 1000);
|
||||
}
|
||||
else{
|
||||
createMessage.error('暂不支持该文件预览!');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
function handleFabu(record: Recordable) {
|
||||
defHttp.post({ url: '/zyZyxx/zyZyxx/edit', params: { id: record.id,sffb:'1' } }).then(res => {
|
||||
handleSuccess();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function handleChehui(record: Recordable) {
|
||||
defHttp.post({ url: '/zyZyxx/zyZyxx/edit', params: { id: record.id,sffb:'0' } }).then(res => {
|
||||
handleSuccess();
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
if(record.sffb == '0'){
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '发布',
|
||||
onClick: handleFabu.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
}
|
||||
}
|
||||
];
|
||||
}else{
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '撤回',
|
||||
onClick: handleChehui.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
queryParam.value = {};
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
width: calc(50% - 15px);
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,154 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="标题" v-bind="validateInfos.title">
|
||||
<a-input v-model:value="formData.title" placeholder="请输入标题" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="内容" v-bind="validateInfos.content">
|
||||
<a-textarea v-model:value="formData.content" rows="4" placeholder="请输入内容" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="资源" v-bind="validateInfos.filePath">
|
||||
<j-upload v-model:value="formData.filePath" :disabled="disabled" ></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否发布" v-bind="validateInfos.sffb">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.sffb" dictCode="yn" placeholder="请选择是否发布" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted ,unref} from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../ZyZyxx.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
//当前路由信息
|
||||
const { currentRoute } = useRouter();
|
||||
const { query } = unref(currentRoute);
|
||||
const { rwbh, xqxn, type, teano } = query; //获取传递参数
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: ()=>{} },
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
title: '',
|
||||
content: '',
|
||||
filePath: '',
|
||||
sffb: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = {
|
||||
title: [{ required: true, message: '请输入标题!'},],
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
//赋值
|
||||
Object.assign(formData, record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
model.rwbh = rwbh;
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
min-height: 500px !important;
|
||||
overflow-y: auto;
|
||||
padding: 24px 24px 24px 24px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,75 @@
|
|||
<template>
|
||||
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<ZyZyxxForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyZyxxForm>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ZyZyxxForm from './ZyZyxxForm.vue'
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue