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

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

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