fix: tag问题修改,提交增加弹框

dev_1.0.0
xiangcongshuai 11 months ago
parent 248515c74f
commit b823116412

@ -15,7 +15,7 @@ export const queryCommonDictTree = (data?: object) => {
export const uploadFile = (data?: object) => {
return http.request(
"post",
"/know-sub/file/uploade",
"/know-sub/file/upload",
{ data },
{ headers: { "Content-Type": "multipart/form-data" } }
);

@ -86,8 +86,8 @@ export default {
"justifyRight", //
"undo", //
"redo", //
"clearStyle", //
"fullScreen" //
"clearStyle" //
// "fullScreen" //
]
};
const editorConfig = {
@ -115,7 +115,7 @@ export default {
uploadFile(form).then(res => {
if (res.code === 200) {
insertFn(
`/virtual-patient-manage/fileManage/downloadFile?fileId=${res.data.id}`,
`/know-sub/file/downloadFile?fileId=${res.data}`,
"",
""
);

@ -137,7 +137,7 @@ const changeRouter = item => {
};
onMounted(() => {
const userInfo: any = getUserInfo();
userName.value = JSON.parse(userInfo).name;
userName.value = JSON.parse(userInfo).username;
});
</script>
@ -192,7 +192,7 @@ onMounted(() => {
<span class="user-set-main">
<!-- <img class="head" :src="userAvatar" :style="avatarsStyle" /> -->
<el-avatar :size="36" :src="userAvatar" />
<p>{{ "欢迎您,凯迪凯迪" }}</p>
<p>{{ `欢迎您,${userName}` }}</p>
<el-icon><CaretBottom /></el-icon>
</span>
<template #dropdown>

@ -1,19 +1,40 @@
<template>
<div class="tabs-container">
<div class="tabs-content">
<div ref="parentDiv" class="tabs-content">
<div @click="goHome" class="home">
<homeIcon />
</div>
<div
ref="childDiv"
@click="clickTabls(item)"
class="tabs-item"
:class="[activePath === item.path ? 'actived' : '']"
v-for="(item, index) in tabs.list"
v-for="(item, index) in tabList"
:key="index"
>
<span>{{ item.title }}</span>
<div class="title">{{ item.title }}</div>
<closeIcon @click.stop="closeTabs(item.path)" />
</div>
<el-dropdown v-if="overTags.length > 0" class="over-item" trigger="click">
<div>
<el-icon><ArrowDown /></el-icon>
</div>
<template #dropdown>
<div class="drop-meun">
<div
@click="clickTabls(item)"
:class="[activePath === item.path ? 'actived' : '']"
class="drop-meun-item"
v-for="(item, index) in overTags"
:key="index"
>
<span>{{ item.title }}</span>
<closeIcon class="icon" @click.stop="closeTabs(item.path)" />
</div>
</div>
</template>
</el-dropdown>
</div>
</div>
</template>
@ -24,11 +45,18 @@ import { onBeforeRouteUpdate, useRoute, useRouter } from "vue-router";
import { useTabsStore } from "@/store/modules/tabs";
import homeIcon from "@/assets/svg/home/home.svg";
import closeIcon from "@/assets/svg/home/close.svg";
import { ArrowDown } from "@element-plus/icons-vue";
import { onMounted } from "vue";
import { computed } from "vue";
const route = useRoute();
const router = useRouter();
const activePath = ref(route.fullPath);
const tabs = useTabsStore();
const parentDiv = ref(null);
const childDivs = ref([]);
const overTags = ref([]);
const overIndex = ref(0);
const isOverflowing = ref(false);
//
const setTags = (route: any) => {
const isExist = tabs.list.some(item => {
@ -50,6 +78,14 @@ onBeforeRouteUpdate(to => {
const goHome = () => {
router.push("/home");
};
const tabList = computed(() => {
if (overTags.value.length > 0) {
return tabs.list.slice(0, overIndex.value);
} else {
return tabs.list;
}
});
//
const closeAll = () => {
tabs.clearTabs();
@ -88,6 +124,9 @@ const closeTabs = (path: string) => {
const index = tabs.list.findIndex(item => item.path === path);
tabs.delTabsItem(index);
const item = tabs.list[index] || tabs.list[index - 1];
if (overIndex.value !== 0) {
overTags.value = tabs.list.slice(overIndex.value);
}
router.push(item ? item.path : "/home");
};
@ -96,10 +135,42 @@ watch(
() => route.fullPath,
(newVal, oldVal) => {
activePath.value = newVal;
getTagsWidth();
}
);
const getTagsWidth = () => {
childDivs.value = parentDiv.value.querySelectorAll(".tabs-item");
let totalWidth = 55;
childDivs.value.forEach(div => {
totalWidth += div.offsetWidth;
});
const residueW = parentDiv.value.offsetWidth - totalWidth;
if (residueW > 100) return;
if (overIndex.value === 0) {
overIndex.value = childDivs.value.length;
}
overTags.value = tabs.list.slice(overIndex.value);
};
// const getResizeTabs = () => {
// overTags.value = [];
// overIndex.value = 0;
// childDivs.value = parentDiv.value.querySelectorAll(".tabs-item");
// let totalWidth = 55;
// childDivs.value.forEach((div, index) => {
// totalWidth += div.offsetWidth;
// if (parentDiv.value.offsetWidth < totalWidth) {
// overIndex.value = index;
// overTags.value = tabs.list.slice(overIndex.value);
// }
// });
// };
onMounted(() => {
console.log("222", tabs.list);
// window.addEventListener("resize", getResizeTabs);
});
</script>
@ -115,11 +186,13 @@ onMounted(() => {
background: #ffffff;
border-radius: 8px 8px 8px 8px;
display: flex;
overflow: hidden;
position: relative;
.home {
display: flex;
align-items: center;
justify-content: center;
width: 68px;
min-width: 68px;
cursor: pointer;
border-right: 1px solid #eaeaea;
}
@ -131,14 +204,59 @@ onMounted(() => {
font-size: 16px;
color: #333333;
cursor: pointer;
span {
.title {
margin-right: 16px;
min-width: 65px;
}
}
.actived {
background: #f5f5f5;
border-bottom: 1px solid #0052d9;
}
.over-item {
width: 69px;
height: 53px;
background: #f5f5f5;
border-radius: 0px 8px 8px 0px;
position: absolute;
right: 0;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
}
}
.drop-meun {
width: 214px;
height: 369px;
background: #ffffff;
box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.15);
border-radius: 8px 8px 8px 8p;
padding: 16px 0px;
.drop-meun-item {
padding-left: 16px;
margin-bottom: 8px;
height: 38px;
line-height: 38px;
display: flex;
font-size: 14px;
color: #333333;
position: relative;
align-items: center;
cursor: pointer;
.icon {
position: absolute;
right: 16px;
cursor: pointer;
}
.drop-meun-item:hover {
background-color: #f5f5f5;
}
}
.actived {
border-left: 1px solid #0052d9;
background-color: #f5f5f5;
}
}
</style>

@ -68,8 +68,7 @@ onBeforeMount(() => {
position: relative;
width: 100%;
height: 100%;
background-image: url("../assets/home/home_bg.png");
background-size: 100% 100%;
&::after {
display: table;
clear: both;
@ -101,6 +100,8 @@ onBeforeMount(() => {
height: 100vh;
min-height: 100%;
overflow-y: hidden;
background-image: url("../assets/home/home_bg.png");
background-size: 100% 100%;
/* main-content 属性动画 */
transition: margin-left var(--pure-transition-duration);

@ -189,4 +189,8 @@
.el-dialog__header {
padding: 0 !important;
margin: 0 !important;
}
}
.is-disabled span {
color: #999999;
}

@ -1,6 +1,5 @@
<script setup lang="ts">
import { onActivated, onMounted, reactive, ref } from "vue";
import { ArrowDown } from "@element-plus/icons-vue";
import { useRouter } from "vue-router";
import TransferRecords from "../compontents/TransferRecords.vue";
import Details from "../compontents/Details.vue";
@ -167,6 +166,7 @@ const handleCommand = command => {
};
const changeStatus = item => {
seachForm.processStatus = item.id;
search();
};
const add = () => {
router.push("/knowledgeCentre/addSubmission");
@ -233,7 +233,6 @@ onActivated(() => {
onMounted(() => {
getDepartmentList();
getApplicationSubLibrary();
getData();
});
</script>

@ -94,7 +94,10 @@ const closeDialog = () => {
`发布日期:${formData.knowledgeInfo.publishDate}`
}}</span>
</div>
<div class="basicInfo_item">
<div
v-if="formData.knowledgeInfo.autoLoseEffect"
class="basicInfo_item"
>
<span v-if="formData.knowledgeInfo.autoLoseEffect === 1">{{
`时效性:长期有效`
}}</span>

@ -0,0 +1,100 @@
<template>
<el-dialog
width="600"
append-to-body
v-model="dialogVisible"
:center="true"
custom-class="SubmitReview"
><!-- 使用自定义头部组件 -->
<template v-slot:header>
<div class="SubmitReview-header">
<img :src="successIcon" alt="" />
<span>提交审核</span>
</div>
</template>
<div class="SubmitReview-content">
<div class="label">报送说明</div>
<el-input
v-model="reason"
maxlength="200"
:rows="4"
placeholder="请输入"
show-word-limit
type="textarea"
/>
<div class="footer-btn">
<div class="cancel_btn" @click="dialogVisible = false">取消</div>
<!-- <div class="determine_btn">确定</div> -->
<el-button
size="large"
@click="submit"
style="width: 140px; margin: 0"
class="footer-btn"
type="primary"
>确定</el-button
>
</div>
</div>
</el-dialog>
</template>
<script setup lang="ts">
import { ref } from "vue";
import successIcon from "@/assets/knowledge/success.png";
import { message } from "@/utils/message";
const dialogVisible = ref(false);
const reason = ref("");
defineExpose({
open() {
dialogVisible.value = true;
}
});
const closeDialog = () => {
dialogVisible.value = false;
};
const emit = defineEmits(["submitOk"]);
const submit = () => {
if (reason.value) {
emit("submitOk", reason.value);
closeDialog();
} else {
message("请填写原因", { type: "error" });
}
};
</script>
<style lang="scss" scoped>
.SubmitReview-header {
display: flex;
align-items: center;
padding: 0 24px;
height: 76px;
border-bottom: 1px solid rgba(91, 139, 255, 0.3);
position: relative;
width: 100%;
span {
font-weight: bold;
font-size: 20px;
color: #333333;
}
img {
width: 28px;
height: 28px;
margin-right: 16px;
}
}
:deep(.el-dialog__header) {
padding: 0;
margin: 0;
}
.SubmitReview-content {
.label {
font-size: 16px;
color: #333333;
margin-bottom: 16px;
}
.desc {
margin-top: 8px;
font-size: 14px;
color: #b4b4b4;
}
}
</style>

@ -52,7 +52,7 @@ const getDetails = async id => {
<div class="line" />
<div class="content">
<div class="content-title">{{ title }}</div>
<div class="record_list">
<div v-if="recordList.length > 0" class="record_list">
<div
class="record_list_item"
v-for="(item, index) in recordList"
@ -88,6 +88,7 @@ const getDetails = async id => {
</div>
</div>
</div>
<el-empty v-else description="暂无流转记录" />
</div>
</div>
</el-drawer>

@ -1,11 +1,12 @@
<script setup lang="ts">
import { ElMessage, UploadProps } from "element-plus";
import { computed, reactive, ref } from "vue";
import { computed, onMounted, reactive, ref } from "vue";
import { Plus } from "@element-plus/icons-vue";
import WangEditor from "@/components/WangEditor/index.vue";
import { useKnowledgeCentreStoreHooks } from "@/store/modules/knowledgeCentre";
import { message } from "@/utils/message";
import { getUserInfo } from "@/utils/auth";
const ruleFormRef = ref();
const formData = reactive({
operate: "",
@ -34,7 +35,10 @@ const formData = reactive({
},
fileList: []
});
let userInfo = reactive({
username: "",
deptName: ""
});
defineExpose({
getDetails(data) {
refWangEditor.value.initText(data.knowledgeContext.context);
@ -174,6 +178,10 @@ const reset = () => {
refWangEditor.value.initText("");
refWangEditor.value.initTitle("");
};
onMounted(() => {
const obj: any = getUserInfo();
userInfo = JSON.parse(obj);
});
</script>
<template>
@ -190,12 +198,20 @@ const reset = () => {
<span>报送知识</span>
</div>
<el-row>
<!-- <el-form-item class="ml-2" label="报送人姓名" prop="normalResult">
<el-input v-model="formData.normalResult" placeholder="请输入" />
<el-form-item class="ml-2" label="报送人姓名" prop="username">
<el-input
disabled
v-model="userInfo.username"
placeholder="请输入"
/>
</el-form-item>
<el-form-item class="ml-8" label="报送人部门" prop="deptName">
<el-input
disabled
v-model="userInfo.deptName"
placeholder="请输入"
/>
</el-form-item>
<el-form-item class="ml-8" label="报送人部门" prop="normalResult">
<el-input v-model="formData.normalResult" placeholder="请输入" />
</el-form-item> -->
</el-row>
</div>
<div class="Editortext">

@ -4,14 +4,30 @@ import { saveKnowledge } from "@/api/knowledgeCentre";
import { useTabsStore } from "@/store/modules/tabs";
import { message } from "@/utils/message";
import { useRoute, useRouter } from "vue-router";
import SubmitReview from "../../compontents/SubmitReview.vue";
import { ref } from "vue";
import { reactive } from "vue";
defineOptions({
name: "addSubmission"
});
const router = useRouter();
const route = useRoute();
const tabs = useTabsStore();
const SubmitReviewRef = ref();
let paramsInfo = reactive({});
const save = async params => {
const res: any = await saveKnowledge(params);
paramsInfo = params;
if (params.operate === 1) {
submitOk(undefined);
} else {
SubmitReviewRef.value.open();
}
};
const submitOk = async val => {
const res: any = await saveKnowledge({
...paramsInfo,
remark: val
});
if (res.code === 200) {
message("新增成功", { type: "success" });
tabs.closeCurrentTag({
@ -25,5 +41,6 @@ const save = async params => {
<template>
<div>
<MainTemplate @save="save" />
<SubmitReview @submitOk="submitOk" ref="SubmitReviewRef" />
</div>
</template>

@ -3,8 +3,9 @@ import MainTemplate from "../MainTemplate.vue";
import { updateKnowledge, queryKnowledgeDetail } from "@/api/knowledgeCentre";
import { useTabsStore } from "@/store/modules/tabs";
import { message } from "@/utils/message";
import { onMounted, ref } from "vue";
import { onMounted, reactive, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import SubmitReview from "../../compontents/SubmitReview.vue";
defineOptions({
name: "editSubmission"
});
@ -12,9 +13,20 @@ const router = useRouter();
const route = useRoute();
const tabs = useTabsStore();
const MainTemplateRef = ref();
const SubmitReviewRef = ref();
let paramsInfo = reactive({});
const save = async params => {
paramsInfo = params;
if (params.operate === 1) {
submitOk(undefined);
} else {
SubmitReviewRef.value.open();
}
};
const submitOk = async val => {
const res: any = await updateKnowledge({
...params,
...paramsInfo,
remark: val,
knowledgeId: route.query.id
});
if (res.code === 200) {
@ -25,7 +37,6 @@ const save = async params => {
});
}
};
const getDeatils = async () => {
const res: any = await queryKnowledgeDetail({
knowledgeId: route.query.id
@ -40,5 +51,6 @@ onMounted(() => {
<template>
<div>
<MainTemplate ref="MainTemplateRef" @save="save" />
<SubmitReview @submitOk="submitOk" ref="SubmitReviewRef" />
</div>
</template>

@ -232,7 +232,7 @@ const openDetails = row => {
DetailsRef.value.open(row.id);
};
const openWithdraw = row => {
withdrawRef.value.open(row);
withdrawRef.value.open(row.id);
};
const handleDelete = row => {
KnowledgeDeleteRef.value.open(row.id);
@ -285,7 +285,6 @@ onActivated(() => {
onMounted(() => {
getDepartmentList();
getApplicationSubLibrary();
getData();
});
</script>

@ -46,7 +46,7 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
proxy: {
// 类型: Record<string, string | ProxyOp 为开发服务器配置自定义代理规则
"/know-sub/": {
target: "http://192.168.10.25:9201/",
target: "http://192.168.10.27:9201/",
changeOrigin: true,
secure: false
// eslint-disable-next-line no-shadow

Loading…
Cancel
Save