提交 101affd3 authored 作者: 龙菲's avatar 龙菲

完善审批重传、批量重传;增加按钮级别权限控制

上级 d1ec8d4f
......@@ -64,3 +64,13 @@ export function putFlowCheck(data) {
})
}
// 通过流程id查询流程详情
export function getSourceDetailById(params) {
return request({
url: '/bizFlow/sourceDetailById',
method: 'get',
params
})
}
<template>
<span>
<el-button v-bind="$attrs" v-on="$listeners" v-if="hasPer && button">
<slot />
</el-button>
<el-link v-bind="$attrs" v-on="$listeners" v-else-if="hasPer">
<slot />
</el-link>
</span>
</template>
<script>
import { mapGetters } from "vuex";
import { loopFunc } from "@/utils/index";
export default {
name: "PermissionButton",
inheritAttrs: false,
props: {
// 是否是按钮
button: {
type: Boolean,
default: false,
},
// 权限code
perms: {
type: String,
default: "",
},
},
computed: {
...mapGetters(["allMenus"]),
},
data() {
return {
hasPer: false,
};
},
watch: {
perms: {
handler(value) {
if (!value) {
return;
}
this.hasPer = this.hasPermission();
},
immediate: true,
},
},
methods: {
hasPermission() {
const allMenus = this.allMenus;
let hasPer = false;
const callback = (item) => {
if (item.perms && item.perms == this.perms) {
hasPer = true;
return;
}
};
loopFunc(allMenus, callback);
return hasPer;
},
},
};
</script>
......@@ -6,7 +6,7 @@
:title="deleteTitle ? deleteTitle : '确定删除吗?'"
@confirm="clickOperation(op)"
>
<el-link
<!-- <el-link
type="danger"
:disabled="disabled"
size="mini"
......@@ -14,10 +14,19 @@
:icon="icons[op.type]"
>
{{ op.title }}</el-link
> -->
<PermissionButton
:perms="op.perms"
type="danger"
:disabled="disabled"
size="mini"
slot="reference"
:icon="icons[op.type]"
>{{ op.title }}</PermissionButton
>
</el-popconfirm>
</span>
<span
<!-- <span
class="view-3d"
v-else-if="op.type == 'view3D'"
@click="clickOperation(op)"
......@@ -25,8 +34,9 @@
<el-link type="primary">
<svg-icon icon-class="three"></svg-icon>{{ op.title }}</el-link
></span
>
<el-link
> -->
<!-- <el-link
v-else-if="op.type == 'view'"
size="mini"
:icon="icons[op.type]"
:disabled="disabled && op.type != 'view'"
......@@ -35,7 +45,19 @@
style="margin-right: 16px"
v-else
>{{ op.title }}
</el-link>
</el-link> -->
<PermissionButton
:perms="op.perms"
size="mini"
:icon="icons[op.type]"
:disabled="disabled && op.type != 'view'"
@click="clickOperation(op)"
type="primary"
style="margin-right: 16px"
v-else
>{{ op.title }}</PermissionButton
>
</span>
</span>
</template>
......
......@@ -10,7 +10,14 @@
:highlight-current-row="true"
@selection-change="handleSelectionChange"
@current-change="handleCurrentChange"
v-bind="$attrs"
>
<el-table-column v-if="needExpand" type="expand">
<template slot-scope="scope">
<!-- 传索引去获取数据中的index项,不然有些数据在config中未显示出来 -->
<slot name="expand" :scope="scope.$index"></slot>
</template>
</el-table-column>
<el-table-column type="index" width="50" label="序号" align="center">
</el-table-column>
<el-table-column v-if="hasMultiSelection" type="selection" width="55" />
......@@ -78,6 +85,7 @@
<span v-else>{{ scope.row[item.prop] }}</span>
</template>
</el-table-column>
<!-- 如果需要自定义最后一栏则需传入operates对象,并提供模板 -->
<el-table-column
v-if="operates.operate"
......@@ -118,13 +126,13 @@ export default {
type: Boolean,
default: false,
},
},
watch: {
data(value) {
// debugger
// console.log(123, value);
needExpand: {
type: Boolean,
default: false,
},
},
// 继承所有父组件的内容
inheritAttrs: true,
methods: {
handleSelectionChange(val) {
if (this.hasMultiSelection) {
......
......@@ -9,7 +9,7 @@
>
<div class="title" slot="title">
<div class="divider"></div>
<span class="label">批量上传文件</span>
<span class="label">{{ getDialogTitle }}</span>
<span class="tips">
<i class="el-icon-info"></i
>提示:上传过程中请勿关闭此弹窗或刷新页面等操作
......@@ -26,6 +26,7 @@
<el-input
placeholder="请输入标题(必填)"
v-model="form.uploadTitle"
:disabled="isDisabledTitle"
></el-input>
</el-form-item>
<el-form-item label="上传文件">
......@@ -65,7 +66,7 @@
v-if="displayList.length > 0"
>
<h3>上传列表</h3>
<el-table :data="displayList" fit v-loading="loading">
<el-table :data="displayList" fit>
<el-table-column prop="name" label="标题"> </el-table-column>
<el-table-column prop="size" label="文件大小">
<template slot-scope="scope">
......@@ -110,7 +111,39 @@
import { importZip } from "@/utils/file";
import { getToken } from "@/utils/auth";
export default {
name: "UploadListDialog",
name: "UploadDialog",
props: {
bizType: {
type: String,
default: "biz_cultural_relic", //biz_cultural_relic——文物,biz_exhibition——展览
},
flowId: {
type: String,
default: "", //流程id
},
title: {
type: String,
default: "", //标题,重传时会带过来
},
},
computed: {
getSize(size) {
return (size) => {
return (size / 1024 / 1024).toFixed(2) + "M"; //1M=1024Kb=1024*1024byte
};
},
importZipUrl() {
if (!this.bizType) {
return;
}
return process.env.VUE_APP_BASE_API + "/bizImport/importZip";
},
getDialogTitle() {
return this.bizType == "biz_cultural_relic"
? "批量上传文物"
: "整量上传展览";
},
},
data() {
return {
dialogVisible: false,
......@@ -127,11 +160,9 @@ export default {
displayList: [], //用于显示下方的文件队列
uploadCount: 0, //处于上传中的文件数量,当等于fileList的时候就关闭弹窗,请求完毕一个就++
cancelUploadArr: [], //保存每个文件上传接口对应的取消请求的函数[fn,fn,fn...],点叉叉关闭弹窗就遍历这个全部执行一遍就取消了所以请求
importZipUrl: process.env.VUE_APP_BASE_API + "/bizImport/importZip",
headers: {
authorization: getToken(),
},
loading: false,
form: {
uploadTitle: "",
},
......@@ -144,15 +175,16 @@ export default {
},
],
},
isDisabledTitle: false,
};
},
computed: {
getSize(size) {
return (size) => {
return (size / 1024 / 1024).toFixed(2) + "M"; //1M=1024Kb=1024*1024byte
};
watch: {
title(value) {
this.form.uploadTitle = value;
this.isDisabledTitle = true;
},
},
methods: {
// 取消编辑
cancelForm() {
......@@ -185,21 +217,31 @@ export default {
// 上传函数实现逻辑
uploadSelf(file, index) {
this.loading = true;
const loading = this.$loading({
lock: true,
text: "正在上传中...文件较大,请耐心等待,请勿刷新页面",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
let formData = new FormData();
formData.append("type", "biz_cultural_relic");
formData.append("type", this.bizType);
formData.append("zipFile", file);
formData.append("title", this.form.uploadTitle);
this.loading = false;
formData.append("flowTitle", this.form.uploadTitle);
if (this.flowId) {
formData.append("flowId", this.flowId);
}
importZip(
formData,
(progressEvent) => this.uploadUnderWayCallback(progressEvent, index),
(cancelCallback) => this.cancelCallBack(cancelCallback, index)
)
.then((res) => {
loading.close();
const { code, msg } = res.data;
if (code == 0) {
this.$set(this.fileList[index], "status", "success");
this.$set(this.fileList[index], "percent", 100);
this.$set(this.fileList[index], "desc", "上传成功");
this.$message.success("文件" + file.name + "上传成功!");
this.$emit("update");
......@@ -215,6 +257,7 @@ export default {
this.$refs.form.resetFields();
})
.catch((err) => {
loading.close();
console.log("err", err);
});
},
......
......@@ -7,8 +7,9 @@ import TableOperation from "./Table/TableOperation.vue";//分页操作
import ManualUploader from "./Uploader/ManualUploader.vue";//上传文件组件
import VueQuillEditor from "@/components/VueQuillEditor";//富文本编辑器
import ElImageViewer from "element-ui/packages/image/src/image-viewer"
import PermissionButton from "@/components/PermissionButton"
const components = [DictText, RichTextShow, SearchBar, TablePage, TableOperation, ElImageViewer, ManualUploader, VueQuillEditor]
const components = [DictText, RichTextShow, SearchBar, TablePage, TableOperation, ElImageViewer, ManualUploader, VueQuillEditor, PermissionButton]
const plugins = {
install(Vue) {
......
......@@ -59,7 +59,9 @@ function gotoRouter(to, next) {
getMenu() // 获取动态路由的方法
.then(res => {
// console.log(res.data.menus);
const asyncRouter = addRouter(res.data.menus); // 进行递归解析
const { menus, allMenus } = res.data
store.dispatch("user/setAllMenus", allMenus);
const asyncRouter = addRouter(menus); // 进行递归解析
return asyncRouter;
//TODO:前端暂时写死
......
......@@ -7,6 +7,7 @@ const getters = {
avatar: state => state.user.avatar,
name: state => state.user.name,
menu: state => state.user.menu,
allMenus: state => state.user.allMenus,
dicts: state => state.dict.dicts,
museumTree: state => state.org.museumTree,
......
......@@ -14,7 +14,10 @@ import {
removeUserInfo,
setLocalMenu,
getLocalMenu,
removeLocalMenu
removeLocalMenu,
setLocalMenuAll,
getLocalMenuAll,
removeLocalMenuAll
} from '@/utils/auth'
import {
resetRouter
......@@ -25,11 +28,13 @@ const getDefaultState = () => {
token: getToken(),
userInfo: getUserInfo(),
menu: getLocalMenu(),
allMenus: getLocalMenuAll(),//包含按钮权限的菜单表
name: '',
avatar: '',
permissionTree: [],
routerList: [], // 动态路由,
init: false, // 是否完成初始化 // 默认未完成
}
}
......@@ -54,6 +59,9 @@ const mutations = {
SET_MENU: (state, menu) => {
state.menu = menu
},
SET_ALL_MENUS: (state, allMenus) => {
state.allMenus = allMenus
},
SET_PERMISSION_TREE_ALL: (state, permissionTree) => {
state.permissionTree = permissionTree
},
......@@ -108,7 +116,8 @@ const actions = {
logout(state.token).then(() => {
removeToken() // must remove token first
removeUserInfo()
removeLocalMenu()
removeLocalMenu()//不含有按钮权限的
removeLocalMenuAll()//含有按钮权限的菜单
resetRouter()
commit('RESET_STATE')
window.location.reload() //刷新路由表
......@@ -134,7 +143,6 @@ const actions = {
getMenuList({
commit
}) {
console.log('getMenuList');
return new Promise((resolve, reject) => {
getMenu().then((res) => {
const {
......@@ -186,7 +194,10 @@ const actions = {
setRouterList({ commit }, routerList) {
commit('set_router', constantRoutes.concat(routerList)) // 进行路由拼接并存储
},
// 设置所有菜单,这个菜单包含了按钮权限按钮,后端将含有按钮权限的数据单独放置在此,menus中不含有按钮权限数据
setAllMenus({ commit }, allMenus) {
commit('SET_ALL_MENUS', allMenus) // 进行路由拼接并存储
}
}
export default {
......
......@@ -3,6 +3,7 @@ import Cookies from 'js-cookie'
const TokenKey = 'exhibition_token'
const UserInfoKey = 'exhibition_userInfo'
const MenuKey = 'exhibition_menu'
const MenuAllKey = 'exhibition_menu_all'
export function getToken() {
// return Cookies.get(TokenKey)
......@@ -30,7 +31,7 @@ export function getUserInfo() {
export function removeUserInfo() {
localStorage.removeItem(UserInfoKey)
}
// 不含有按钮权限的菜单
export function setLocalMenu(menu) {
return localStorage.setItem(MenuKey, JSON.stringify(menu))
}
......@@ -43,3 +44,17 @@ export function getLocalMenu() {
export function removeLocalMenu() {
localStorage.removeItem(MenuKey)
}
// 含有按钮权限的菜单
export function setLocalMenuAll(allMenus) {
return localStorage.setItem(MenuAllKey, JSON.stringify(allMenus))
}
export function getLocalMenuAll() {
return JSON.parse(localStorage.getItem(MenuAllKey))
}
export function removeLocalMenuAll() {
localStorage.removeItem(MenuAllKey)
}
......@@ -248,3 +248,21 @@ export const isElementInViewport2 = function (content) {
content.offsetTop < scrollTop + clientHeight)
}
};
/**
*
* @param {Array} arr 数据数组
* @param {Function} callback 循环处理什么事
*/
export function loopFunc(arr, callback) {
// debugger
if (arr.length > 0) {
arr.forEach(item => {
callback(item)
if (item.children) {
loopFunc(item.children, callback)
}
});
}
}
\ No newline at end of file
......@@ -268,14 +268,32 @@
<div class="dialog-footer">
<el-button @click="handleClose" size="mini">取 消</el-button>
<el-button
<!-- <el-button
type="primary"
size="mini"
@click="handleSubmit"
:loading="loading"
preventReClick
>确定<i class="el-icon-circle-check" style="margin-left: 5px"></i
></el-button>
></el-button> -->
<el-button
size="mini"
type="primary"
@click="handleSubmit(0)"
:disabled="loading"
icon="el-icon-document-checked"
>
只保存
</el-button>
<el-button
size="mini"
type="primary"
@click="handleSubmit(1)"
icon="el-icon-circle-check"
:disabled="loading"
>保存并提交审核
</el-button>
</div>
</div>
</div>
......@@ -307,6 +325,11 @@ export default {
type: Object,
default: () => ({}),
},
// 流程id,重传时需要
flowId: {
type: String,
default: "",
},
},
computed: {
...mapGetters(["userInfo", "dicts"]),
......@@ -453,15 +476,12 @@ export default {
return submitForm;
},
// 提交表单
handleSubmit() {
handleSubmit(submitFlag) {
this.$refs.form.validate(async (valid, err) => {
if (valid) {
this.submitLoading = true;
// console.log('this.removedIds',this.removedIds);
// return
this.uploadMediaFiles(this.mediaKeys, this.dialogForm)
.then(async (mediaForm) => {
// console.log(mediaForm);
this.loadingText = "正在提交表单...";
const form = this.getSubmitForm(this.dialogForm, mediaForm);
const { status, years, textureType, deptId } = form;
......@@ -471,6 +491,10 @@ export default {
form.years = this.processYear(years);
form.textureType = this.processTextureType(textureType);
form.deptId = getDeptIdStr(deptId);
form.submitFlag = submitFlag;
if (this.flowId) {
form.flowId = this.flowId;
}
const res = await addOrUpdateCulturalRelic(form);
this.submitLoading = false;
if (res.code == 0) {
......@@ -480,7 +504,6 @@ export default {
this.visible = false;
this.reset();
this.$emit("refresh");
// 提交成功后再删除,因为可能没成功的话要保留原本的数据
}
})
.catch((err) => {
......
......@@ -262,11 +262,13 @@ export const operates = {
export const operationsTemp = [
{
type: 'edit',
title: '编辑'
title: '编辑',
perms: 'bizCulturalRelic:update'
},
{
type: 'delete',
title: '删除'
title: '删除',
perms: 'bizCulturalRelic:delete'
},
]
......@@ -275,7 +277,8 @@ export const operationsTemp = [
export const operations = [
{
type: 'delete',
title: '删除'
title: '删除',
perms: 'bizCulturalRelic:delete'
},
]
......
......@@ -148,7 +148,7 @@ import {
editCulturalRelic,
} from "@/api/culturalRelic";
import InfoEditDialog from "./components/InfoEditDialog";
import UploadDialog from "./components/UploadDialog";
import UploadDialog from "@/components/UploadDialog"; //上传弹窗
import ImportRecordDialog from "./components/ImportRecordDialog";
import View3dDialog from "./components/View3dDialog";
import { rules } from "./configs/validateRules";
......
......@@ -72,13 +72,14 @@
</el-pagination>
</div>
<div class="dialog-footer">
<el-button type="primary" size="mini" @click.native="handleClose">关闭</el-button>
<el-button type="primary" size="mini" @click.native="handleClose"
>关闭</el-button
>
</div>
</el-dialog>
</template>
<script>
import {
importRecordsTitle,
importOperates,
......@@ -163,38 +164,14 @@ export default {
type: "dateTimeRange",
label: "操作日期",
},
// {
// prop: "type",
// type: "select",
// label: "所属分类",
// selectOptions: [
// {
// label: "文物",
// value: "biz_cultural_relic",
// },
// {
// label: "展览",
// value: "biz_exhibition",
// },
// ],
// },
// {
// prop: "batchNum",
// type: "input",
// label: "批次",
// },
],
};
},
// mounted() {
// this.loadData();
// },
methods: {
async search(form) {
var params = {
page: this.list.current,
limit: this.list.size,
// type:'biz_exhibition',
optType: "整量",
...form,
};
......@@ -207,7 +184,6 @@ export default {
if (params.createTime) {
delete params.createTime;
}
// let res = await getImportListPage(params);
let res = await getLogList(params);
if (res.code == 0) {
this.list = res.data;
......@@ -274,7 +250,7 @@ export default {
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.title {
display: flex;
.divider {
......
......@@ -3,7 +3,7 @@
v-loading="submitLoading"
element-loading-background="rgba(0, 0, 0, 0.5)"
:element-loading-text="loadingText"
:visible.sync="dialogVisible"
:visible.sync="visible"
width="80%"
:before-close="handleClose"
top="2vh"
......@@ -25,7 +25,7 @@
</div>
</div>
<div class="el-dialog-div">
<div class="dialog-content" v-if="dialogVisible" id="dialog-content">
<div class="dialog-content" v-if="visible" id="dialog-content">
<el-form
size="mini"
:model="dialogForm"
......@@ -400,10 +400,6 @@ export default {
ExhibitionUnit,
},
props: {
visible: {
type: Boolean,
default: false,
},
form: {
type: Object,
default: () => ({}),
......@@ -427,13 +423,6 @@ export default {
},
},
watch: {
visible: {
handler: function (value) {
this.dialogVisible = value;
},
deep: true,
immediate: true,
},
form: {
handler: function (value) {
if (!value) {
......@@ -497,7 +486,7 @@ export default {
},
regionTree: [],
imagesAdvice: "",
dialogVisible: false,
visible: false,
nextDiaplayId: null,
prevDiaplayId: null,
currentId: null,
......@@ -538,7 +527,11 @@ export default {
deptId,
exhibitionUnits,
} = this.dialogForm;
this.faceImage = faceImageToClient(faceImage,faceImageUrl,faceImagePressUrl );
this.faceImage = faceImageToClient(
faceImage,
faceImageUrl,
faceImagePressUrl
);
this.images = imagesVo || [];
this.videos = videosVo || [];
this.audios = audiosVo || [];
......@@ -949,7 +942,7 @@ export default {
// 清空编辑组件中的所有值
reload() {
//父组件将清空form绑定的值
this.$emit("handleClose");
// this.$emit("handleClose");
// 清空文献
this.literatureIdArr = [];
// 清空文物
......@@ -977,9 +970,9 @@ export default {
handleClose(done) {
this.$confirm("确认关闭?")
.then((_) => {
done();
this.reload();
this.submitLoading = false;
done();
})
.catch((_) => {});
},
......
......@@ -267,28 +267,33 @@ export const operates = {
// 临时表
export const operationsTemp = [
{
type: "view",
title: "预览",
},
// {
// type: "view",
// title: "预览",
// perms: "bizExhibition:list"
// },
{
type: "edit",
title: "编辑",
perms: 'bizExhibition:update'
},
{
type: "delete",
title: "删除",
perms: 'bizExhibition:delete'
},
];
// 最终表
export const operations = [
{
type: "edit",
title: "编辑",
},
// {
// type: "edit",
// title: "编辑",
// perms: 'bizExhibition:update'
// },
{
type: "delete",
title: "删除",
perms: 'bizExhibition:delete'
},
];
......@@ -26,33 +26,22 @@
>
</div>
<div class="tools-item">
<el-button
<PermissionButton
pers="bizExhibition:add"
type="primary"
size="mini"
@click.native="handleOperation({ type: 'add' })"
icon="el-icon-plus"
>添加</PermissionButton
>
添加</el-button
>
<el-upload
class="upload-button"
:action="importZipUrl"
:headers="headers"
accept=".zip"
:show-file-list="false"
:before-upload="handleUpload"
:on-success="handleSuccess"
multiple
>
<el-button
<PermissionButton
pers="bizExhibition:add"
type="success"
size="mini"
@click.native="handleOperation({ type: 'multiAdd' })"
icon="el-icon-upload"
>整量导入</PermissionButton
>
整量导入</el-button
>
</el-upload>
</div>
</div>
<div class="list">
......@@ -88,7 +77,6 @@
{{ dicts.displayType[data.scope.type] }}
</template>
<template v-slot:checkStatus="data">
<!-- {{ data.scope.checkStatus }} -->
<el-tag type="primary" v-if="data.scope.checkStatus == 0">
审核中
</el-tag>
......@@ -173,6 +161,11 @@
@handleClose="handleMultiUploadClose"
@handleCancel="handleMultiUploadCancel"
/>
<UploadDialog
ref="UploadDialog"
bizType="biz_exhibition"
@update="loadData"
/>
<el-image-viewer
v-if="imgViewerVisible"
......@@ -200,7 +193,8 @@ import {
import InfoEditDialog from "./components/InfoEditDialog";
import PreviewDialog from "./components/PreviewDialog";
import ImportRecordDialog from "./components/ImportRecordDialog";
import UploadListDialog from "./components/UploadListDialog";
import UploadListDialog from "./components/UploadListDialog"; //上传列表弹窗
import UploadDialog from "@/components/UploadDialog"; //上传弹窗
import { mapGetters } from "vuex";
import { themeTypeCode } from "./contants";
import { getToken } from "@/utils/auth";
......@@ -213,6 +207,7 @@ export default {
PreviewDialog,
ImportRecordDialog,
UploadListDialog,
UploadDialog,
},
data() {
return {
......@@ -260,10 +255,6 @@ export default {
displayTypes: {},
curPreviewObj: {}, //当前预览的对象
currentPageIds: [], //当前的id数组,用于给详情页切换用
importZipUrl: process.env.VUE_APP_BASE_API + "/bizImport/importZip",
headers: {
authorization: getToken(),
},
multiUploadVisible: false, //控制批量上传弹窗显示
importRecordVisible: false, //上传记录
filesList: [], //上传当中的文件队列
......@@ -420,10 +411,7 @@ export default {
}
break;
case "multiAdd":
// debugger
// this.multiUploadVisible = true;
// console.log("this.multiUploadVisible", this.multiUploadVisible);
this.$refs.UploadDialog.visible = true;
break;
case "downloadTemplate":
......
......@@ -30,6 +30,7 @@
/>
<CulturalRelicTable
:crList="culturalRelicPageVo"
:flowId="detail.id"
v-if="item == '文物列表'"
/>
<DisplayBaseInfo
......@@ -72,10 +73,10 @@ export default {
},
},
// provide必须返回一个函数,不然更新后无法获取最新的值
provide(){
provide() {
return {
handleClosePreviewDialog:this.handleClose
}
handleClosePreviewDialog: this.handleClose,
};
},
computed: {
...mapGetters(["dicts"]),
......
......@@ -61,7 +61,7 @@ export default {
default: "",
},
},
inject: ["handleClosePreviewDialog"],
inject: ["handleClosePreviewDialog", "loadData"],
data() {
return {
checkStatus: 1, //1同意 -2驳回
......@@ -108,6 +108,8 @@ export default {
this.$message.success("操作成功!");
// 关闭弹窗
this.handleClosePreviewDialog();
// 重新加载审批列表
this.loadData();
// 重置数据
this.$refs.form.resetFields();
}
......
......@@ -28,7 +28,6 @@
<h3>详细流程节点</h3>
<el-steps
:active="info.checkDetailList.length"
align-center
v-if="info.checkDetailList.length > 0"
>
<el-step
......
......@@ -2,7 +2,7 @@
<!-- 文物基本信息 -->
<div>
<el-card shadow="hover">
<el-descriptions title="文物基本详情" :column="1" labelClassName="label">
<el-descriptions title="文物详情" :column="1" labelClassName="label">
<el-descriptions-item
:label="item.label"
v-for="(item, index) in crTabletitle"
......@@ -20,6 +20,7 @@
<span v-else></span>
</div>
<div v-else-if="item.prop == 'imagesVo'">
<span v-if="isImagesVoEmpty"></span>
<el-image
v-for="(v, i) in info['imagesVo']"
:key="i"
......@@ -29,33 +30,28 @@
:preview-src-list="imgsList"
>
</el-image>
<span v-if="info['imagesVo'].length == 0"></span>
</div>
<div v-else-if="item.prop == 'videosVo'">
<span v-if="isVideosVoEmpty"></span>
<VideoPlayer
class="video"
v-for="(v, i) in info['videosVo']"
:key="i"
:src="v.url"
/>
<span v-if="info['videosVo'].length == 0"></span>
</div>
<div v-else-if="item.prop == 'audiosVo'">
<span v-if="isAudiosVoEmpty"></span>
<AudioPlayer
v-for="(v, i) in info['audiosVo']"
:key="i"
:url="v.url"
ref="AudioPlayer"
/>
<span v-if="info['audiosVo'].length == 0"></span>
</div>
<div v-else-if="item.prop == 'literatureVo'">
<el-table
stripe
border
:data="info['literatureVo']"
v-if="info['literatureVo'].length > 0"
>
<span v-if="isLiteratureVoEmpty"></span>
<el-table stripe border :data="info['literatureVo']" v-else>
<el-table-column prop="name" label="名称"></el-table-column>
<el-table-column prop="authors" label="作者"></el-table-column>
<el-table-column prop="source" label="来源"></el-table-column>
......@@ -65,9 +61,19 @@
</template>
</el-table-column>
</el-table>
<span v-if="info['literatureVo'].length == 0"></span>
</div>
<div v-else-if="item.prop === 'intro'" v-html="info['intro']"></div>
<RichTextShow
v-else-if="item.prop === 'intro'"
:richText="info['intro']"
></RichTextShow>
<div v-else-if="item.prop === 'sourceWay'">
<DictText
name="culturalRelicSourceWay"
:dictValue="info['sourceWay']"
v-if="info['sourceWay']"
/>
<span v-else></span>
</div>
<span v-else>{{ info[item.prop] || "无" }}</span>
</el-descriptions-item>
</el-descriptions>
......@@ -97,6 +103,20 @@ export default {
return item.url;
});
},
isImagesVoEmpty() {
return !(this.info["imagesVo"] && this.info["imagesVo"].length > 0);
},
isAudiosVoEmpty() {
return !(this.info["audiosVo"] && this.info["audiosVo"].length > 0);
},
isVideosVoEmpty() {
return !(this.info["videosVo"] && this.info["videosVo"].length > 0);
},
isLiteratureVoEmpty() {
return !(
this.info["literatureVo"] && this.info["literatureVo"].length > 0
);
},
},
data() {
return {
......
<template>
<div>
<!-- 文物清单表格 -->
<TablePage :data="crList.records" :tableTitle="crTabletitle">
<TablePage
:data="list.records"
:tableTitle="crTabletitle"
needExpand
height="500px"
>
<template v-slot:status="data">
<el-switch
slot="reference"
:value="Boolean(Number(data.scope.status))"
></el-switch>
</template>
<template v-slot:expand="data">
<CulturalRelicBaseInfo :info="list.records[data.scope]" />
</template>
<template v-slot:faceImagePressUrl="data">
<img
:src="$getFullUrl(data.scope.faceImagePressUrl)"
......@@ -22,39 +30,60 @@
/>
</template>
</TablePage>
<!-- <el-pagination
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="Number(crList.current)"
:current-page="Number(list.current)"
:page-sizes="[10, 20, 40, 50]"
:page-size="Number(crList.size)"
:page-size="Number(list.size)"
layout="total, sizes, prev, pager, next, jumper"
:total="Number(crList.total)"
:total="Number(list.total)"
class="pagination"
>
</el-pagination> -->
</el-pagination>
</div>
</template>
<script>
import TablePage from "@/components/Table/TablePage.vue";
import CulturalRelicBaseInfo from "./CulturalRelicInfo.vue";
import { crTabletitle } from "../../config";
import { getListFlowCulturalRelicByPage } from "@/api/approval";
export default {
components: {
TablePage,
CulturalRelicBaseInfo,
},
props: {
crList: {
type: Object,
default: () => ({}),
},
flowId: {
type: String,
default: "",
},
},
data() {
return {
crTabletitle,
list: {
records: {},
size: 10,
current: 1,
total: 0,
},
};
},
watch: {
crList: {
handler(value) {
const { records, size, current, total } = value;
this.list = { records, size, current, total };
},
deep: true,
immediate: true,
},
},
methods: {
// 改变页容量
handleSizeChange(value) {
......@@ -67,8 +96,25 @@ export default {
this.list.current = value;
this.loadData();
},
async loadData(form) {
const { current, size } = this.list;
var params = {
page: current,
limit: size,
flowId: this.flowId,
};
const res = await getListFlowCulturalRelicByPage(params);
if (res.code == 0) {
this.list = res.data;
}
},
},
};
</script>
<style></style>
<style lang="scss" scoped>
.pagination {
margin-top: 20px;
}
</style>
......@@ -96,37 +96,22 @@ export const operates = {
export const viewButton = {
type: 'view',
title: '查看详情'
title: '查看详情',
perms: "bizCheck:list"
}
export const approvalButton = {
type: 'approval',
title: '审批'
title: '审批',
perms: "bizCheck:check"
}
export const reSubmitButtton = {
type: 'reSubmit',
title: '重新上传'
title: '重新上传',
perms: "bizCheck:update"
}
// export const operations = [
// {
// type: 'view',
// title: '查看详情'
// },
// {
// type: 'approval',
// title: '审批'
// },
// {
// type: 'reSubmit',
// title: '重新上传'
// }
// ]
// 文物的展示字段
export const crTabletitle = [{
prop: "name",
......@@ -199,30 +184,30 @@ export const crTabletitle = [{
columnAlign: 'center',
isFaceImage: true,
},
{
prop: "imagesVo",
label: "文物图片",
columnAlign: 'center',
isFaceImage: true,
},
{
prop: "audiosVo",
label: "文物音频",
columnAlign: 'center',
isFaceImage: true,
},
{
prop: "videosVo",
label: "文物视频",
columnAlign: 'center',
isFaceImage: true,
},
{
prop: "literatureVo",
label: "相关文献",
columnAlign: 'center',
isFaceImage: true,
},
// {
// prop: "imagesVo",
// label: "文物图片",
// columnAlign: 'center',
// isFaceImage: true,
// },
// {
// prop: "audiosVo",
// label: "文物音频",
// columnAlign: 'center',
// isFaceImage: true,
// },
// {
// prop: "videosVo",
// label: "文物视频",
// columnAlign: 'center',
// isFaceImage: true,
// },
// {
// prop: "literatureVo",
// label: "相关文献",
// columnAlign: 'center',
// isFaceImage: true,
// },
// {
// prop: "statusLabel",
// label: "上下架状态",
......
......@@ -66,15 +66,21 @@
/>
<CrInfoEditDialog
ref="CrInfo"
:form="form"
:form="resubmitCrInfo"
@refresh="loadData"
:flowId="currentFlowId"
/>
<DisplayInfoEditDialog
ref="CrInfo"
:form="form"
@handleClose="handleEditClose"
ref="displayInfo"
:form="resubmitDisplayInfo"
@refresh="loadData"
/>
<UploadDialog
ref="UploadDialog"
@update="loadData"
:title="currentFlowTitle"
:flowId="currentFlowId"
/>
</div>
</template>
......@@ -82,6 +88,7 @@
import PreviewDialog from "./components/PreviewDialog.vue";
import CrInfoEditDialog from "@/views/culturalRelic/components/InfoEditDialog";
import DisplayInfoEditDialog from "@/views/display/components/InfoEditDialog";
import UploadDialog from "@/components/UploadDialog";
import {
approvleTableTitle,
operates,
......@@ -92,8 +99,7 @@ import {
import {
getFlowListPagePer,
getFlowDetailById,
getFlowCulturalRelicDetail,
getFlowExhibitionDetail,
getSourceDetailById,
} from "@/api/approval";
import { mapGetters } from "vuex";
......@@ -102,6 +108,13 @@ export default {
PreviewDialog,
CrInfoEditDialog,
DisplayInfoEditDialog,
UploadDialog,
},
// provide必须返回一个对象,不然更新后无法获取最新的值
provide() {
return {
loadData: this.loadData,
};
},
data() {
return {
......@@ -111,6 +124,7 @@ export default {
current: 1,
total: 0,
},
searchParams: "",
searchConfig: [
{
prop: "title",
......@@ -120,15 +134,34 @@ export default {
{
prop: "sourceType",
type: "select",
label: "类别",
label: "资源类型",
selectOptions: [
{
label: "文物",
value: "文物",
},
{
label: "展览",
value: "展览",
label: "展览展示",
value: "展览展示",
},
],
},
{
prop: "addWay",
type: "select",
label: "添加方式",
selectOptions: [
{
label: "批量导入",
value: "批量导入",
},
{
label: "整量导入",
value: "整量导入",
},
{
label: "手动添加",
value: "手动添加",
},
],
},
......@@ -144,10 +177,13 @@ export default {
aprrovalDetail: {}, //审核的相关信息
prviewType: "view", //预览类型,view-查看详情,approval-审批
operates,
// operations,
approvleTableTitle,
resubmitCrInfo:{},//重传的文物信息
resubmitDisplayInfo:{},//重传的展览信息
currentFlowId: "", //当前点击的流程的ID
resubmitCrInfo: {}, //重传的手动添加的文物信息
resubmitDisplayInfo: {}, //重传的手动添加的展览信息
resubmitCrMulti: {}, //重传的批量导入的文物信息
resubmitDisplayMulti: {}, //重传的整量导入的展览信息
currentFlowTitle: "", //当前重传的流程的title
};
},
computed: {
......@@ -174,6 +210,7 @@ export default {
},
methods: {
async search(form) {
this.searchParams = form;
this.loadData(form);
},
reset() {
......@@ -214,77 +251,64 @@ export default {
return;
}
},
// 重新上传
async resubmit(row) {
console.log(row);
// return
const { addWay, sourceType, id } = row;
console.log(addWay, sourceType);
const isManual = sourceType == "手动添加";
const { addWay, sourceType, id, title } = row;
const isManual = addWay == "手动添加";
this.currentFlowId = id;
switch (sourceType) {
case "文物":
if (isManual) {
const params = {
crId: "", //TODO:问后端文物ID是什么,row里面没有
flowId: id,
};
const res = await getFlowCulturalRelicDetail(params);
if (res.code == 0) {
const data = await this.getSourceDetail(this.currentFlowId);
this.resubmitCrInfo = data;
this.openResubmitDialog("CrInfo");
this.resubmitCrInfo = res.data;
}
} else {
this.openResubmitDialog("CrMulti");
this.currentFlowTitle = title;
this.openResubmitDialog("UploadDialog");
}
break;
case "展览展示":
if (isManual) {
const data = await this.getSourceDetail(this.currentFlowId);
this.resubmitDisplayInfo = data;
this.openResubmitDialog("DisplayInfo");
} else {
this.currentFlowTitle = title;
this.openResubmitDialog("UploadDialog");
}
break;
}
},
// 获取资源详情
getSourceDetail(id) {
return new Promise(async (resolve, reject) => {
try {
const params = {
exhibitionId: "", //TODO:问后端展览ID是什么,row里面没有
flowId: id,
id,
};
const res = await getFlowExhibitionDetail(params);
const res = await getSourceDetailById(params);
if (res.code == 0) {
this.openResubmitDialog("DisplayInfo");
this.resubmitDisplayInfo = res.data;
}
resolve(res.data);
} else {
this.openResubmitDialog("DisplayMulti");
reject(false);
}
break;
} catch (error) {
reject(error);
}
});
},
// 打开文物编辑重传弹窗
openResubmitDialog(name) {
this.$refs[name].visible = true;
},
// 关闭文物编辑重传弹窗
closeResubmitDialog(name) {
this.$refs[name].visible = false;
},
// // 关闭批量文物重传弹窗
// closeResubmitCrMulti() {
// this.$refs.CrMultiResubmit.visible = false;
// },
// // 打开展览编辑重传弹窗
// openResubmitDisplayInfo() {
// this.displayInfoResubmitVisible = true;
// },
// // 打开整量展览重传弹窗
// openResubmitDislayMulti() {
// this.displayMultiResubmitVisible = true;
// },
// // 打开文物编辑重传弹窗
// closeResubmitDisplayInfo() {
// this.displayInfoResubmitVisible = false;
// },
// // 打开批量文物重传弹窗
// closeResubmitDislayMulti() {
// this.displayMultiResubmitVisible = false;
// },
// 多选
handleSelectionChange(val) {
this.multipleSelection = val;
......
......@@ -4,46 +4,46 @@ export const title = [{
columnAlign: 'center',
width: 200,
showOverFlowToolTip: true
},
{
},
{
prop: "authors",
label: "作者",
columnAlign: 'center',
},
},
{
{
prop: "browseCount",
label: "浏览量",
columnAlign: 'center',
},
{
},
{
prop: "status",
label: "状态",
columnAlign: 'center',
isStatus: true,
width: 100
},
{
},
{
prop: "date",
label: "出版/发布日期",
columnAlign: 'center',
},
// {
// prop: "pdfFile",
// label: "pdf文件",
// columnAlign: 'center',
// },
{
},
// {
// prop: "pdfFile",
// label: "pdf文件",
// columnAlign: 'center',
// },
{
prop: "source",
label: "文献来源",
columnAlign: 'center',
},
{
},
{
prop: "remark",
label: "备注",
columnAlign: 'center',
showOverFlowToolTip: true,
},
},
]
......@@ -58,19 +58,23 @@ export const operates = {
export const operations = [{
type: 'view',
title: '预览'
},
{
title: '预览',
perms: 'sysLiterature:list'
},
{
type: 'download',
title: '下载'
},
{
title: '下载',
perms: 'sysLiterature:list'
},
{
type: 'edit',
title: '编辑'
},
{
title: '编辑',
perms: "sysLiterature:update"
},
{
type: 'delete',
title: '删除'
},
title: '删除',
perms: 'sysLiterature:delete'
},
]
......@@ -2,13 +2,15 @@
<div class="app-container">
<div class="top-bar">
<SearchBar :config="searchConfig" @search="search" @reset="reset" />
<el-button
<PermissionButton
button
perms="sysLiterature:add"
size="mini"
type="primary"
@click.native="handleOperation({ type: 'add' })"
icon="el-icon-plus"
>
添加</el-button
添加</PermissionButton
>
</div>
<TablePage
......
......@@ -2,13 +2,15 @@
<div class="app-container">
<div class="top-bar">
<SearchBar :config="searchConfig" @search="search" @reset="reset" />
<el-button
<PermissionButton
perms="sys:dept:add"
size="mini"
type="primary"
@click.native="handleOperation('add')"
button
>
<i class="el-icon-plus"></i>
添加</el-button
添加</PermissionButton
>
</div>
......@@ -73,24 +75,26 @@
</el-table-column> -->
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
<PermissionButton
:perms="'sys:dept:update'"
type="primary"
size="mini"
icon="el-icon-edit"
@click.native="handleOperation('edit', scope.row)"
style="margin-right: 4px"
>编辑</el-button
style="margin-right: 16px"
>编辑</PermissionButton
>
<el-popconfirm
title="确定删除吗?"
@confirm="handleOperation('delete', scope.row)"
>
<el-button
<PermissionButton
:perms="'sys:dept:deleted'"
size="mini"
type="danger"
icon="el-icon-delete"
slot="reference"
>删除</el-button
>删除</PermissionButton
>
</el-popconfirm>
</template>
......@@ -112,7 +116,6 @@
</template>
<script>
import { title, operates, operations } from "./config";
import InfoEditDialog from "./components/InfoEditDialog";
import { deleteMuseum, editMuseum } from "@/api/org";
export default {
......@@ -161,15 +164,6 @@ export default {
};
},
computed: {
tableTitle() {
return title;
},
tableOperates() {
return operates;
},
tableOperations() {
return operations;
},
getStatusTitle(status) {
return (status) => {
if (Number(status)) {
......
......@@ -52,11 +52,13 @@ export const operations = [
// },
{
type: 'edit',
title: '编辑'
title: '编辑',
perms:'bizCcProducts:update'
},
{
type: 'delete',
title: '删除'
title: '删除',
perms:'bizCcProducts:delete'
},
]
......@@ -2,13 +2,15 @@
<div class="app-container">
<div class="top-bar">
<SearchBar :config="searchConfig" @search="search" @reset="reset" />
<el-button
<PermissionButton
button
perms="bizCcProducts:add"
size="mini"
type="primary"
@click.native="handleOperation({ type: 'add' })"
icon="el-icon-plus"
>
添加</el-button
添加</PermissionButton
>
</div>
<TablePage
......
......@@ -43,15 +43,18 @@ export const operates = {
export const operations = [
{
type: 'edit',
title: '编辑'
title: '编辑',
perms: "sys:role:update"
},
{
type: 'dataPermission',
title: '数据权限'
title: '数据权限',
perms: "sys:role:bindDept",
},
{
type: 'delete',
title: '删除'
title: '删除',
perms: "sys:role:deleted"
},
]
......@@ -2,13 +2,15 @@
<div class="app-container">
<div class="top-bar">
<SearchBar :config="searchConfig" @search="search" @reset="reset" />
<el-button
<PermissionButton
perms="sys:role:add"
button
size="mini"
type="primary"
@click.native="handleOperation({ type: 'add' })"
icon="el-icon-plus"
>
新建</el-button
新建</PermissionButton
>
</div>
<TablePage
......
......@@ -52,20 +52,24 @@ export const operates = {
export const operations = [
{
type:'editPassword',
title: '修改密码'
title: '修改密码',
perms: "sys:user:update",
},
{
type: 'edit',
title: '编辑'
title: '编辑',
perms: "sys:user:update",
},
{
type: 'editRole',
title: '赋予角色'
title: '赋予角色',
perms: "sys:user:update",
},
{
type: 'delete',
title: '删除'
title: '删除',
perms: "sys:user:deleted",
},
]
......@@ -16,13 +16,15 @@
<el-col :span="20">
<div class="top-bar">
<SearchBar :config="searchConfig" @search="search" @reset="reset" />
<el-button
<PermissionButton
perms="sys:user:add"
button
size="mini"
type="primary"
@click.native="handleOperation({ type: 'add' })"
icon="el-icon-plus"
>
新增</el-button
新增</PermissionButton
>
</div>
<TablePage
......
......@@ -51,11 +51,12 @@ export const operations = [
// },
{
type: 'edit',
title: '编辑'
title: '编辑',
perms:'bizVirtual:update'
},
{
type: 'delete',
title: '删除'
},
title: '删除',
perms:'bizVirtual:delete'
}
]
......@@ -2,13 +2,15 @@
<div class="app-container">
<div class="top-bar">
<SearchBar :config="searchConfig" @search="search" @reset="reset" />
<el-button
<PermissionButton
button
perms="bizVirtual:add"
size="mini"
type="primary"
@click.native="handleOperation({ type: 'add' })"
icon="el-icon-plus"
>
添加</el-button
添加</PermissionButton
>
</div>
<TablePage
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论