From 8ba57678bb7b37293fb966a82ab1a73853941e9b Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期五, 03 四月 2026 09:33:12 +0800
Subject: [PATCH] feat: 将知识库模块从会议管理迁移至协同办公
---
/dev/null | 500 --------------------------
src/pages.json | 16
src/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/detail.vue | 515 +++++++++++++++++++++++++++
src/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/index.vue | 94 +++-
src/pages/works.vue | 2
src/pages/indexItem.vue | 2
6 files changed, 586 insertions(+), 543 deletions(-)
diff --git a/src/pages.json b/src/pages.json
index 060bdad..4291f7e 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -458,9 +458,16 @@
}
},
{
- "path": "pages/managementMeetings/knowledgeBase/index",
+ "path": "pages/cooperativeOffice/collaborativeApproval/knowledgeBase/index",
"style": {
"navigationBarTitleText": "鐭ヨ瘑搴�",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/cooperativeOffice/collaborativeApproval/knowledgeBase/detail",
+ "style": {
+ "navigationBarTitleText": "鐭ヨ瘑搴撹鎯�",
"navigationStyle": "custom"
}
},
@@ -496,13 +503,6 @@
"path": "pages/managementMeetings/rulesRegulationsManagement/fileList",
"style": {
"navigationBarTitleText": "瑙勭珷鍒跺害鏂囦欢绠$悊",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/managementMeetings/knowledgeBase/detail",
- "style": {
- "navigationBarTitleText": "鐭ヨ瘑搴撹鎯�",
"navigationStyle": "custom"
}
},
diff --git a/src/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/detail.vue b/src/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/detail.vue
new file mode 100644
index 0000000..88af8c9
--- /dev/null
+++ b/src/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/detail.vue
@@ -0,0 +1,515 @@
+<template>
+ <view class="client-visit-detail">
+ <PageHeader :title="detailType === 1 ? '鏂板鐭ヨ瘑' : (detailType === 2 ? '缂栬緫鐭ヨ瘑' : '鐭ヨ瘑璇︽儏')"
+ @back="goBack" />
+ <view class="form-container">
+ <u-form ref="formRef"
+ :model="form"
+ label-width="90">
+ <u-cell-group title="鍩烘湰淇℃伅">
+ <u-form-item label="鐭ヨ瘑鏍囬"
+ prop="title"
+ required
+ border-bottom>
+ <u-input v-model="form.title"
+ :readonly="readonly"
+ placeholder="璇疯緭鍏ョ煡璇嗘爣棰�" />
+ </u-form-item>
+ <u-form-item label="鐭ヨ瘑绫诲瀷"
+ prop="type"
+ required
+ border-bottom>
+ <u-input v-model="typeName"
+ readonly
+ placeholder="璇烽�夋嫨鐭ヨ瘑绫诲瀷"
+ @click="!readonly && (showTypeSheet = true)" />
+ <template v-if="!readonly"
+ #right>
+ <up-icon name="arrow-right"
+ @click="showTypeSheet = true"></up-icon>
+ </template>
+ </u-form-item>
+ <u-form-item label="閫傜敤鍦烘櫙"
+ prop="scenario"
+ border-bottom>
+ <u-input v-model="form.scenario"
+ :readonly="readonly"
+ placeholder="璇疯緭鍏ラ�傜敤鍦烘櫙" />
+ </u-form-item>
+ <u-form-item label="瑙e喅鏁堢巼"
+ prop="efficiency"
+ border-bottom>
+ <u-input v-model="efficiencyName"
+ readonly
+ placeholder="璇烽�夋嫨瑙e喅鏁堢巼"
+ @click="!readonly && (showEfficiencySheet = true)" />
+ <template v-if="!readonly"
+ #right>
+ <up-icon name="arrow-right"
+ @click="showEfficiencySheet = true"></up-icon>
+ </template>
+ </u-form-item>
+ </u-cell-group>
+
+ <u-cell-group title="璇︾粏鍐呭">
+ <u-form-item label="闂鎻忚堪"
+ required
+ prop="problem"
+ border-bottom>
+ <u-textarea v-model="form.problem"
+ rows="4"
+ :disabled="readonly"
+ placeholder="璇疯緭鍏ラ棶棰樻弿杩�" />
+ </u-form-item>
+ <u-form-item label="瑙e喅鏂规"
+ prop="solution"
+ required
+ border-bottom>
+ <u-textarea v-model="form.solution"
+ rows="4"
+ :disabled="readonly"
+ placeholder="璇疯緭鍏ヨВ鍐虫柟妗�" />
+ </u-form-item>
+ <u-form-item label="鍏抽敭瑕佺偣"
+ prop="keyPoints"
+ border-bottom>
+ <u-textarea v-model="form.keyPoints"
+ rows="4"
+ :disabled="readonly"
+ placeholder="璇疯緭鍏ュ叧閿鐐癸紝鐢ㄩ�楀彿鍒嗛殧" />
+ </u-form-item>
+ </u-cell-group>
+
+ <u-cell-group title="鍏朵粬淇℃伅">
+ <u-form-item label="鍒涘缓浜�"
+ prop="creator"
+ border-bottom>
+ <u-input v-model="form.creator"
+ readonly
+ placeholder="璇烽�夋嫨鍒涘缓浜�"
+ @click="!readonly && (showCreatorSheet = true)" />
+ <template v-if="!readonly"
+ #right>
+ <up-icon name="arrow-right"
+ @click="showCreatorSheet = true"></up-icon>
+ </template>
+ </u-form-item>
+ <u-form-item label="浣跨敤娆℃暟"
+ prop="usageCount"
+ border-bottom>
+ <uni-number-box v-model="form.usageCount"
+ :min="0"
+ :disabled="readonly" />
+ </u-form-item>
+ </u-cell-group>
+
+ <u-cell-group title="闄勪欢鏉愭枡">
+ <view class="upload-section">
+ <view class="upload-tip" v-if="!readonly">
+ 鏀寔鏂囨。锛坉oc, docx, xls, xlsx, pdf, txt锛夊拰鍥剧墖锛坖pg, jpeg, png, gif锛夋牸寮�
+ </view>
+ <view class="file-list" v-if="form.commonFileList && form.commonFileList.length > 0">
+ <view v-for="(file, index) in form.commonFileList" :key="index" class="file-item">
+ <up-icon name="file-text" size="20" color="#667eea"></up-icon>
+ <text class="file-name" @click="previewFile(file)">{{ file.name || file.fileName }}</text>
+ <up-icon v-if="!readonly" name="close-circle-fill" size="18" color="#ff4d4f" @click="handleRemoveFile(index)"></up-icon>
+ </view>
+ </view>
+ <view v-if="!readonly" class="upload-btn-container">
+ <up-upload :fileList="fileList"
+ @afterRead="afterRead"
+ @delete="deleteFile"
+ multiple
+ :maxCount="10"
+ :previewImage="true">
+ <view class="custom-upload-btn">
+ <up-icon name="plus" size="24" color="#999"></up-icon>
+ <text>娣诲姞闄勪欢</text>
+ </view>
+ </up-upload>
+ </view>
+ </view>
+ </u-cell-group>
+ </u-form>
+
+ <!-- 鎻愪氦鎸夐挳 -->
+ <view v-if="!readonly"
+ class="footer-btns">
+ <u-button class="cancel-btn"
+ @click="goBack">鍙栨秷</u-button>
+ <u-button class="sign-btn"
+ type="primary"
+ @click="handleSubmit"
+ :loading="loading">淇濆瓨</u-button>
+ </view>
+ </view>
+
+ <!-- 閫夋嫨鍣� -->
+ <up-action-sheet :show="showTypeSheet"
+ :actions="typeOptions"
+ title="璇烽�夋嫨鐭ヨ瘑绫诲瀷"
+ @select="onTypeSelect"
+ @close="showTypeSheet = false" />
+ <up-action-sheet :show="showEfficiencySheet"
+ :actions="efficiencyOptions"
+ title="璇烽�夋嫨瑙e喅鏁堢巼"
+ @select="onEfficiencySelect"
+ @close="showEfficiencySheet = false" />
+ <up-action-sheet :show="showCreatorSheet"
+ :actions="creatorOptions"
+ title="璇烽�夋嫨鍒涘缓浜�"
+ @select="onCreatorSelect"
+ @close="showCreatorSheet = false" />
+ </view>
+</template>
+
+<script setup>
+ import { ref, onMounted, computed } from "vue";
+ import { onLoad } from "@dcloudio/uni-app";
+ import PageHeader from "@/components/PageHeader.vue";
+ import useUserStore from "@/store/modules/user";
+ import { useDict } from "@/utils/dict";
+ import {
+ addKnowledgeBase,
+ updateKnowledgeBase,
+ } from "@/api/managementMeetings/knowledgeBase";
+ import { userListNoPageByTenantId } from "@/api/system/user";
+ import upload from "@/utils/upload";
+
+ defineOptions({ name: "knowledge-base-detail" });
+
+ const showToast = message => {
+ uni.showToast({
+ title: message,
+ icon: "none",
+ });
+ };
+
+ const userStore = useUserStore();
+
+ // 椤甸潰鐘舵��
+ const detailType = ref(1); // 1-鏂板, 2-缂栬緫, 3-璇︽儏
+ const knowledgeId = ref("");
+ const readonly = ref(false);
+ const loading = ref(false);
+ const formRef = ref(null);
+
+ // 琛ㄥ崟鏁版嵁
+ const form = ref({
+ title: "",
+ type: "",
+ scenario: "",
+ efficiency: "",
+ problem: "",
+ solution: "",
+ keyPoints: "",
+ creator: userStore.nickName || "",
+ usageCount: 0,
+ tempFileIds: [],
+ commonFileList: []
+ });
+
+ // 閫夋嫨鍣ㄧ姸鎬�
+ const showTypeSheet = ref(false);
+ const showEfficiencySheet = ref(false);
+ const showCreatorSheet = ref(false);
+
+ // 鏁版嵁瀛楀吀
+ const { knowledge_type } = useDict("knowledge_type");
+ const typeOptions = computed(() => {
+ return (knowledge_type?.value || []).map(item => ({
+ name: item.label,
+ value: item.value
+ }));
+ });
+
+ const typeName = computed(() => {
+ const item = typeOptions.value.find(i => String(i.value) === String(form.value.type));
+ return item ? item.name : (form.value.type || "");
+ });
+
+ const efficiencyOptions = [
+ { name: "鏄捐憲鎻愬崌", value: "high" },
+ { name: "涓�鑸彁鍗�", value: "medium" },
+ { name: "杞诲井鎻愬崌", value: "low" }
+ ];
+
+ const efficiencyName = computed(() => {
+ const item = efficiencyOptions.find(i => i.value === form.value.efficiency);
+ return item ? item.name : (form.value.efficiency || "");
+ });
+
+ const creatorOptions = ref([]);
+
+ // 鏂囦欢涓婁紶鐩稿叧
+ const fileList = ref([]);
+
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
+
+ // 閫夋嫨澶勭悊
+ const onTypeSelect = (action) => {
+ form.value.type = action.value;
+ showTypeSheet.value = false;
+ };
+
+ const onEfficiencySelect = (action) => {
+ form.value.efficiency = action.value;
+ showEfficiencySheet.value = false;
+ };
+
+ const onCreatorSelect = (action) => {
+ form.value.creator = action.name;
+ showCreatorSheet.value = false;
+ };
+
+ // 鑾峰彇鍒涘缓浜哄垪琛�
+ const getCreatorOptions = async () => {
+ try {
+ const res = await userListNoPageByTenantId();
+ if (res.code === 200) {
+ creatorOptions.value = (res.data || []).map(item => ({
+ name: item.nickName,
+ value: item.userId
+ }));
+ }
+ } catch (e) {
+ console.error("鑾峰彇鍒涘缓浜哄垪琛ㄥけ璐�:", e);
+ }
+ };
+
+ // 鏂囦欢澶勭悊
+ const afterRead = async (event) => {
+ const { file } = event;
+ const lists = [].concat(file);
+
+ for (let i = 0; i < lists.length; i++) {
+ const item = lists[i];
+ try {
+ uni.showLoading({ title: '涓婁紶涓�...' });
+ const res = await upload({
+ url: '/file/upload',
+ filePath: item.url,
+ name: 'file'
+ });
+ uni.hideLoading();
+
+ if (res.code === 200) {
+ if (!form.value.tempFileIds) form.value.tempFileIds = [];
+ form.value.tempFileIds.push(res.data.tempId);
+
+ if (!form.value.commonFileList) form.value.commonFileList = [];
+ form.value.commonFileList.push({
+ id: res.data.tempId,
+ name: item.name || '鏈懡鍚嶆枃浠�',
+ url: res.data.url
+ });
+
+ showToast('涓婁紶鎴愬姛');
+ } else {
+ showToast(res.msg || '涓婁紶澶辫触');
+ }
+ } catch (e) {
+ uni.hideLoading();
+ console.error('涓婁紶澶辫触:', e);
+ showToast('涓婁紶澶辫触');
+ }
+ }
+ };
+
+ const deleteFile = (event) => {
+ const { index } = event;
+ form.value.commonFileList.splice(index, 1);
+ if (form.value.tempFileIds) {
+ form.value.tempFileIds.splice(index, 1);
+ }
+ };
+
+ const handleRemoveFile = (index) => {
+ form.value.commonFileList.splice(index, 1);
+ if (form.value.tempFileIds) {
+ form.value.tempFileIds.splice(index, 1);
+ }
+ };
+
+ const previewFile = (file) => {
+ if (file.url) {
+ // 濡傛灉鏄浘鐗囷紝棰勮鍥剧墖
+ const isImage = /\.(jpg|jpeg|png|gif)$/i.test(file.name || file.fileName || file.url);
+ if (isImage) {
+ uni.previewImage({
+ urls: [file.url]
+ });
+ } else {
+ // 鍏朵粬鏂囦欢灏濊瘯鎵撳紑
+ uni.downloadFile({
+ url: file.url,
+ success: (res) => {
+ if (res.statusCode === 200) {
+ uni.openDocument({
+ filePath: res.tempFilePath,
+ success: () => console.log('鎵撳紑鏂囨。鎴愬姛')
+ });
+ }
+ }
+ });
+ }
+ }
+ };
+
+ // 鎻愪氦琛ㄥ崟
+ const handleSubmit = async () => {
+ if (!form.value.title) return showToast("璇疯緭鍏ョ煡璇嗘爣棰�");
+ if (!form.value.type) return showToast("璇烽�夋嫨鐭ヨ瘑绫诲瀷");
+ if (!form.value.problem) return showToast("璇疯緭鍏ラ棶棰樻弿杩�");
+ if (!form.value.solution) return showToast("璇疯緭鍏ヨВ鍐虫柟妗�");
+
+ try {
+ loading.value = true;
+ const apiCall = detailType.value === 1 ? addKnowledgeBase : updateKnowledgeBase;
+ const res = await apiCall(form.value);
+ loading.value = false;
+
+ if (res.code === 200) {
+ showToast("淇濆瓨鎴愬姛");
+ setTimeout(() => goBack(), 500);
+ } else {
+ showToast(res.msg || "淇濆瓨澶辫触");
+ }
+ } catch (e) {
+ loading.value = false;
+ console.error("淇濆瓨澶辫触:", e);
+ showToast("绯荤粺寮傚父锛屼繚瀛樺け璐�");
+ }
+ };
+
+ onLoad(options => {
+ detailType.value = Number(options.detailType || 1);
+ knowledgeId.value = options.id || "";
+ readonly.value = detailType.value === 3;
+
+ if (detailType.value !== 1) {
+ try {
+ const cached = uni.getStorageSync("knowledgeBase");
+ if (cached) {
+ // 纭繚鏁版嵁鏄璞$被鍨�
+ const data = typeof cached === 'string' ? JSON.parse(cached) : cached;
+
+ // 濡傛灉浼犲叆浜� id锛屽垯鏍¢獙 id 鏄惁涓�鑷�
+ if (!knowledgeId.value || String(data.id) === String(knowledgeId.value)) {
+ form.value = JSON.parse(JSON.stringify(data));
+ // 鍏煎澶勭悊鏂囦欢鍒楄〃
+ if (form.value.commonFileList) {
+ form.value.tempFileIds = form.value.commonFileList.map(f => f.id || f.tempId);
+ }
+ }
+ }
+ } catch (e) {
+ console.error("瑙f瀽缂撳瓨鏁版嵁澶辫触:", e);
+ }
+ }
+ });
+
+ onMounted(() => {
+ getCreatorOptions();
+ });
+</script>
+
+<style scoped lang="scss">
+ @import "@/static/scss/form-common.scss";
+
+ .client-visit-detail {
+ min-height: 100vh;
+ background: #f8f9fa;
+ padding-bottom: 80px;
+ }
+
+ .form-container {
+ padding: 10px;
+ background: #fff;
+ }
+
+ .upload-section {
+ padding: 15px 0;
+
+ .section-title {
+ font-size: 14px;
+ color: #333;
+ font-weight: bold;
+ margin-bottom: 10px;
+ }
+
+ .upload-tip {
+ font-size: 12px;
+ color: #999;
+ margin-bottom: 10px;
+ }
+
+ .file-list {
+ margin-bottom: 15px;
+
+ .file-item {
+ display: flex;
+ align-items: center;
+ background: #f5f7fa;
+ padding: 8px 12px;
+ border-radius: 4px;
+ margin-bottom: 8px;
+
+ .file-name {
+ flex: 1;
+ margin: 0 10px;
+ font-size: 14px;
+ color: #667eea;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+ }
+ }
+
+ .custom-upload-btn {
+ width: 80px;
+ height: 80px;
+ border: 1px dashed #d9d9d9;
+ border-radius: 4px;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ background: #fafafa;
+
+ text {
+ font-size: 12px;
+ color: #999;
+ margin-top: 5px;
+ }
+ }
+
+ .footer-btns {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: #fff;
+ display: flex;
+ justify-content: space-around;
+ align-items: center;
+ padding: 15px 0;
+ box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
+ z-index: 100;
+
+ .u-button {
+ width: 45%;
+ border-radius: 25px;
+ }
+
+ .sign-btn {
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+ border: none;
+ }
+ }
+</style>
diff --git a/src/pages/managementMeetings/knowledgeBase/index.vue b/src/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/index.vue
similarity index 85%
rename from src/pages/managementMeetings/knowledgeBase/index.vue
rename to src/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/index.vue
index ff78fdb..5370e3c 100644
--- a/src/pages/managementMeetings/knowledgeBase/index.vue
+++ b/src/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/index.vue
@@ -10,11 +10,11 @@
<up-input class="search-text"
placeholder="璇疯緭鍏ョ煡璇嗘爣棰�"
v-model="name"
- @blur="getList"
+ @blur="handleQuery"
clearable />
</view>
<view class="filter-button"
- @click="getList">
+ @click="handleQuery">
<u-icon name="search"
size="24"
color="#999"></u-icon>
@@ -70,21 +70,23 @@
<u-button type="info"
size="small"
class="action-btn"
- @click="viewDetail(item,3)">
- 鏌ョ湅
- </u-button>
- <!-- <u-button type="error"
- size="small"
- class="action-btn"
- @click="confirmDelete(item)">
- 鍒犻櫎
+ plain
+ @click="viewDetail(item, 3)">
+ 鏌ョ湅璇︽儏
</u-button>
<u-button type="primary"
size="small"
class="action-btn"
- @click="viewDetail(item,2)">
+ @click="viewDetail(item, 2)">
缂栬緫
- </u-button> -->
+ </u-button>
+ <u-button type="error"
+ size="small"
+ class="action-btn"
+ plain
+ @click="confirmDelete(item)">
+ 鍒犻櫎
+ </u-button>
</view>
</view>
</view>
@@ -94,12 +96,12 @@
<text>鏆傛棤鐭ヨ瘑璁板綍</text>
</view>
<!-- 娴姩鏂板鎸夐挳 -->
- <!-- <view class="fab-button"
+ <view class="fab-button"
@click="addVisit">
<up-icon name="plus"
size="24"
color="#ffffff"></up-icon>
- </view> -->
+ </view>
</view>
</template>
@@ -113,16 +115,15 @@
delKnowledgeBase,
} from "@/api/managementMeetings/knowledgeBase";
import useUserStore from "@/store/modules/user";
- // 鏇挎崲 toast 鏂规硶
- defineOptions({ name: "client-visit-index" });
+
+ defineOptions({ name: "knowledge-base-index" });
+
const showToast = message => {
uni.showToast({
title: message,
icon: "none",
});
};
-
- import dayjs from "dayjs";
const userStore = useUserStore();
@@ -136,11 +137,14 @@
const goBack = () => {
uni.navigateBack();
};
+
const { knowledge_type } = useDict("knowledge_type");
+
// 鏍煎紡鍖栧洖娆炬柟寮�
const formatReceiptType = params => {
return getKnowledgeTypeLabel(params);
};
+
const formatReceiptType1 = params => {
if (params == "high") {
return "鏄捐憲鎻愬崌";
@@ -152,6 +156,7 @@
return "鏈煡";
}
};
+
const getTagClass = type => {
if (type == "high") {
return "success";
@@ -163,10 +168,11 @@
return "info";
}
};
+
const knowledgeTypeOptions = computed(() => knowledge_type?.value || []);
+
// 鑾峰彇鐭ヨ瘑绫诲瀷鏍囩
const getKnowledgeTypeLabel = val => {
- console.log(knowledgeTypeOptions, "knowledgeTypeOptions");
const item = knowledgeTypeOptions.value.find(
i => String(i.value) === String(val)
);
@@ -174,6 +180,10 @@
};
// 鏌ヨ鍒楄〃
+ const handleQuery = () => {
+ getList();
+ };
+
const getList = () => {
showLoadingToast("鍔犺浇涓�...");
const params = {
@@ -208,16 +218,16 @@
// 鏂板鎷滆 - 璺宠浆鍒扮櫥璁伴〉闈�
const addVisit = () => {
uni.navigateTo({
- url: "/pages/managementMeetings/knowledgeBase/detail?detailType=1",
+ url: "/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/detail?detailType=1",
});
};
- // 缂栬緫
+ // 鏌ョ湅/缂栬緫
const viewDetail = (item, detailType) => {
uni.setStorageSync("knowledgeBase", item);
uni.navigateTo({
url:
- "/pages/managementMeetings/knowledgeBase/detail?detailType=" +
+ "/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/detail?detailType=" +
detailType +
"&id=" +
item.id,
@@ -266,7 +276,7 @@
</script>
<style scoped lang="scss">
- @import "../../../styles/sales-common.scss";
+ @import "../../../../styles/sales-common.scss";
// 椤甸潰鐗瑰畾鐨勬牱寮忚鐩�
.sales-accoun {
@@ -292,19 +302,37 @@
color: #333; // 淇濇寔椤甸潰鐗规湁鐨勬枃鏈鑹�
}
- // 鐘舵�佹牱寮�
- .status-enabled {
- color: #28a745; // 淇濇寔椤甸潰鐗规湁鐨勬垚鍔熼鑹�
- }
-
- .status-disabled {
- color: #dc3545; // 淇濇寔椤甸潰鐗规湁鐨勯敊璇鑹�
- }
-
// 鐗瑰畾鐨勬诞鍔ㄦ寜閽牱寮�
.fab-button {
background: #667eea; // 淇濇寔椤甸潰鐗规湁鐨勮儗鏅壊
box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3); // 淇濇寔椤甸潰鐗规湁鐨勯槾褰辨晥鏋�
+ position: fixed;
+ bottom: 40px;
+ right: 20px;
+ width: 50px;
+ height: 50px;
+ border-radius: 50%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ z-index: 100;
+ }
+
+ .action-buttons {
+ display: flex;
+ justify-content: flex-end;
+ gap: 10px;
+ margin-top: 10px;
+ padding-bottom: 10px;
+ }
+
+ .action-btn {
+ margin: 0 !important;
+ }
+
+ .no-data {
+ padding: 50px 0;
+ text-align: center;
+ color: #999;
}
</style>
-
diff --git a/src/pages/indexItem.vue b/src/pages/indexItem.vue
index 61f6c15..d776553 100644
--- a/src/pages/indexItem.vue
+++ b/src/pages/indexItem.vue
@@ -67,7 +67,7 @@
"浼氳鎬荤粨": "/pages/managementMeetings/meetSummary/index",
"浼氳鐪嬫澘": "/pages/managementMeetings/meetingBoard/index",
"閫氱煡鍏憡": "/pages/cooperativeOffice/noticeManagement/index",
- "鐭ヨ瘑搴�": "/pages/managementMeetings/knowledgeBase/index",
+ "鐭ヨ瘑搴�": "/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/index",
"鐢ㄥ嵃绠$悊": "/pages/managementMeetings/sealManagement/index",
"瑙勭珷鍒跺害": "/pages/managementMeetings/rulesRegulationsManagement/index",
"瀹㈡埛鎷滆": "/pages/cooperativeOffice/clientVisit/index",
diff --git a/src/pages/managementMeetings/knowledgeBase/detail.vue b/src/pages/managementMeetings/knowledgeBase/detail.vue
deleted file mode 100644
index a79e4bc..0000000
--- a/src/pages/managementMeetings/knowledgeBase/detail.vue
+++ /dev/null
@@ -1,500 +0,0 @@
-<template>
- <view class="client-visit-detail">
- <PageHeader :title="detailType === 1 ? '鏂板鐭ヨ瘑搴�' : '鐭ヨ瘑搴撹鎯�'"
- @back="goBack" />
- <u-form ref="formRef"
- label-width="90">
- <!-- 瀹㈡埛淇℃伅 -->
- <!-- <u-cell-group title="鐭ヨ瘑淇℃伅"> -->
- <u-form-item label="鐭ヨ瘑鏍囬"
- prop="title"
- required
- border-bottom>
- <u-input v-model="form.title"
- :readonly="readonly"
- placeholder="璇疯緭鍏ョ煡璇嗘爣棰�" />
- </u-form-item>
- <u-form-item label="鐭ヨ瘑绫诲瀷"
- prop="type"
- required
- border-bottom>
- <u-input v-model="equipmentname"
- readonly
- placeholder="璇烽�夋嫨鐭ヨ瘑绫诲瀷"
- @click="showEquipmentSheet = true" />
- <template v-if="!readonly"
- #right>
- <up-icon name="arrow-right"
- @click="openEquipmentSheet"></up-icon>
- </template>
- </u-form-item>
- <u-form-item label="閫傜敤鍦烘櫙"
- prop="scenario"
- border-bottom>
- <u-input v-model="form.scenario"
- :readonly="readonly"
- placeholder="璇疯緭鍏ラ�傜敤鍦烘櫙" />
- </u-form-item>
- <u-form-item label="瑙e喅鏁堢巼"
- prop="status"
- border-bottom>
- <u-input v-model="statusname"
- readonly
- placeholder="璇烽�夋嫨瑙e喅鏁堢巼"
- @click="showStatusSheet = true" />
- <template v-if="!readonly"
- #right>
- <up-icon name="arrow-right"
- @click="showStatusSheet = true"></up-icon>
- </template>
- </u-form-item>
- <u-form-item label="闂鎻忚堪"
- required
- prop="remark"
- border-bottom>
- <u-textarea v-model="form.problem"
- type="textarea"
- rows="4"
- :disabled="readonly"
- placeholder="璇疯緭鍏ラ棶棰樻弿杩�" />
- </u-form-item>
- <u-form-item label="瑙e喅鏂规"
- prop="solution"
- required
- border-bottom>
- <u-textarea v-model="form.solution"
- type="textarea"
- rows="4"
- :disabled="readonly"
- placeholder="璇疯緭鍏ヨВ鍐虫柟妗�" />
- </u-form-item>
- <u-form-item label="鍏抽敭瑕佺偣"
- prop="keyPoints"
- border-bottom>
- <u-textarea v-model="form.keyPoints"
- type="textarea"
- rows="4"
- :disabled="readonly"
- placeholder="璇疯緭鍏ュ叧閿鐐癸紝鐢ㄩ�楀彿鍒嗛殧" />
- </u-form-item>
- <u-form-item label="鍒涘缓浜�"
- prop="creator"
- border-bottom>
- <u-input v-model="form.creator"
- readonly
- placeholder="璇烽�夋嫨鍒涘缓浜�"
- @click="openCreatorSheet" />
- <template v-if="!readonly"
- #right>
- <up-icon name="arrow-right"
- @click="openCreatorSheet"></up-icon>
- </template>
- <!-- <u-input v-model="form.creator"
- :readonly="readonly"
- placeholder="璇疯緭鍏ュ垱寤轰汉" /> -->
- </u-form-item>
- <u-form-item label="浣跨敤娆℃暟"
- prop="usageCount"
- border-bottom>
- <uni-number-box v-model="form.usageCount"
- :min="0"
- :disabled="readonly"
- placeholder="璇疯緭鍏ヤ娇鐢ㄦ鏁�" />
- </u-form-item>
- <!-- </u-cell-group> -->
- <!-- 鎻愪氦鎸夐挳 -->
- <view v-if="!readonly"
- class="footer-btns">
- <u-button class="cancel-btn"
- @click="goBack">鍙栨秷</u-button>
- <u-button class="sign-btn"
- type="primary"
- @click="handleSubmit"
- :loading="loading">淇濆瓨</u-button>
- </view>
- </u-form>
- <!-- 璁惧閰嶇疆閫夋嫨鍣� -->
- <up-action-sheet :show="showEquipmentSheet"
- :actions="equipmentOptions"
- @select="handleEquipmentChange"
- @close="showEquipmentSheet = false" />
- <up-action-sheet :show="showCreatorSheet"
- :actions="creatorOptions"
- @select="handleCreatorChange"
- @close="showCreatorSheet = false" />
- <!-- <u-popup :show="showEquipmentSheet"
- mode="bottom"
- @close="showEquipmentSheet = false"
- height="200px">
- <view class="popup-content">
- <view class="popup-body">
- <u-checkbox-group v-model="form.equipment"
- @change="handleEquipmentChange"
- icon-placement="right"
- placement="row">
- <view style="width:100%;padding:10px;margin-top:20px;">
- <u-checkbox v-for="option in equipmentOptions"
- :key="option.value"
- :name="option.value"
- :label="option.name"
- class="checkbox-item"></u-checkbox>
- </view>
- </u-checkbox-group>
- </view>
- </view>
- </u-popup> -->
- <!-- 鐘舵�侀�夋嫨鍣� -->
- <up-action-sheet :show="showStatusSheet"
- :actions="statusOptions"
- @select="onStatusSelect"
- @close="showStatusSheet = false" />
- </view>
-</template>
-
-<script setup>
- // 鏇挎崲 toast 鏂规硶
- defineOptions({ name: "meeting-settings-detail" });
- const showToast = message => {
- uni.showToast({
- title: message,
- icon: "none",
- });
- };
-
- import { ref, onMounted, computed } from "vue";
- import PageHeader from "@/components/PageHeader.vue";
- import useUserStore from "@/store/modules/user";
- import { useDict } from "@/utils/dict";
- import { onLoad } from "@dcloudio/uni-app";
- import {
- addKnowledgeBase,
- updateKnowledgeBase,
- } from "@/api/managementMeetings/knowledgeBase";
- import { userListNoPageByTenantId } from "@/api/system/user";
-
- const userStore = useUserStore();
-
- // 琛ㄥ崟鏁版嵁
- const form = ref({
- title: "",
- type: "",
- scenario: "",
- efficiency: "",
- problem: "",
- solution: "",
- keyPoints: "",
- creator: "",
- usageCount: 0,
- });
- const { knowledge_type } = useDict("knowledge_type");
- const knowledgeTypeOptions = computed(() => knowledge_type?.value || []);
- const equipmentOptions = ref([]);
- const statusOptions = ref([
- { value: "high", name: "鏄捐憲鎻愬崌" },
- { value: "medium", name: "涓�鑸彁鍗�" },
- { value: "low", name: "杞诲井鎻愬崌" },
- ]);
- //// 椤甸潰鐘舵��
- const loading = ref(false);
- const formRef = ref(null);
- const showEquipmentSheet = ref(false);
- const showStatusSheet = ref(false);
- const openEquipmentSheet = () => {
- showEquipmentSheet.value = true;
- };
- // 杩斿洖涓婁竴椤�
- const goBack = () => {
- uni.navigateBack();
- };
- const statusname = ref("");
- // 鐘舵�侀�夋嫨
- const onStatusSelect = action => {
- form.value.efficiency = action.value;
- statusname.value = action.name;
- showStatusSheet.value = false;
- };
- const showCreatorSheet = ref(false);
- const creatorOptions = ref([]);
- const openCreatorSheet = () => {
- showCreatorSheet.value = true;
- };
- const getCreatorOptions = async () => {
- try {
- const res = await userListNoPageByTenantId();
- if (res.code === 200) {
- creatorOptions.value = res.data || [];
- creatorOptions.value.forEach(item => {
- item.name = item.nickName;
- item.value = item.userId;
- });
- } else {
- showToast("鑾峰彇鍒涘缓浜哄垪琛ㄥけ璐�");
- }
- } catch (e) {
- console.error("鑾峰彇鍒涘缓浜哄垪琛ㄥけ璐�:", e);
- showToast("鑾峰彇鍒涘缓浜哄垪琛ㄥけ璐�");
- }
- };
- // 鍒涘缓浜洪�夋嫨
- const handleCreatorChange = val => {
- form.value.creator = val.name;
- };
- const equipmentname = ref("");
- // 璁惧閰嶇疆閫夋嫨
- const handleEquipmentChange = val => {
- form.value.type = val.value;
- equipmentname.value = val.name;
- showEquipmentSheet.value = false;
- };
- // 鎻愪氦琛ㄥ崟
- const handleSubmit = async () => {
- if (!form.value.title) {
- showToast("璇疯緭鍏ユ爣棰�");
- return;
- }
-
- if (!form.value.scenario) {
- showToast("璇疯緭鍏ラ�傜敤鍦烘櫙");
- return;
- }
-
- if (!form.value.problem) {
- showToast("璇疯緭鍏ラ棶棰樻弿杩�");
- return;
- }
- if (!form.value.solution) {
- showToast("璇疯緭鍏ヨВ鍐虫柟妗�");
- return;
- }
- try {
- loading.value = true;
- if (detailType.value === 1) {
- addKnowledgeBase(form.value).then(res => {
- if (res.code !== 200) {
- showToast("淇濆瓨澶辫触锛岃閲嶈瘯");
- return;
- }
- loading.value = false;
- showToast("淇濆瓨鎴愬姛");
- setTimeout(() => {
- goBack();
- }, 500);
- });
- } else if (detailType.value === 2) {
- updateKnowledgeBase(form.value).then(res => {
- if (res.code !== 200) {
- showToast("淇濆瓨澶辫触锛岃閲嶈瘯");
- return;
- }
- loading.value = false;
- showToast("淇濆瓨鎴愬姛");
- setTimeout(() => {
- goBack();
- }, 500);
- });
- }
- } catch (e) {
- loading.value = false;
- console.error("淇濆瓨澶辫触:", e);
- showToast("淇濆瓨澶辫触锛岃閲嶈瘯");
- }
- };
-
- // 鍒濆鍖栭〉闈㈡暟鎹�
- const initPageData = () => {
- // 浠庢湰鍦板瓨鍌ㄤ腑鑾峰彇浼氳 room 鏁版嵁
- const meetingRoom = uni.getStorageSync("meetingRoom");
- if (meetingRoom) {
- form.value = JSON.parse(JSON.stringify(meetingRoom));
- if (meetingRoom.equipment) {
- if (Array.isArray(meetingRoom.equipment)) {
- form.value.equipment = meetingRoom.equipment;
- } else {
- form.value.equipment = meetingRoom.equipment.split(",");
- }
- }
- statusname.value = meetingRoom.status === 1 ? "鍚敤" : "绂佺敤";
-
- // 娓呴櫎鏈湴瀛樺偍涓殑鏁版嵁锛岄伩鍏嶄笅娆℃墦寮�鏃朵粛鐒舵樉绀�
- uni.removeStorageSync("meetingRoom");
- }
- };
- const readonly = ref(false);
- const detailType = ref(1);
- const knowledgeId = ref("");
-
- onLoad(options => {
- detailType.value = Number(options.detailType);
- knowledgeId.value = options.id || "";
-
- // 濡傛灉鏄紪杈戞垨鏌ョ湅妯″紡锛岃幏鍙栫煡璇嗚鎯�
- if (knowledgeId.value && (detailType.value === 2 || detailType.value === 3)) {
- // getKnowledgeDetail(knowledgeId.value);
- equipmentname.value =
- equipmentOptions.value.find(item => item.value === form.value.type)
- ?.name || "";
- statusname.value =
- statusOptions.value.find(item => item.value === form.value.efficiency)
- ?.name || "";
- }
-
- // 鏌ョ湅妯″紡璁剧疆鍙
- if (detailType.value === 3) {
- readonly.value = true;
- }
- });
-
- onMounted(() => {
- getCreatorOptions();
- // 浠庢湰鍦板瓨鍌ㄤ腑鑾峰彇鐭ヨ瘑鏁版嵁
- const knowledgeBase = uni.getStorageSync("knowledgeBase");
- if (knowledgeBase) {
- form.value = JSON.parse(JSON.stringify(knowledgeBase));
- }
-
- initPageData();
- equipmentOptions.value = knowledgeTypeOptions.value.map(item => ({
- value: item.value,
- name: item.label,
- }));
- if (detailType.value === 1) {
- form.value = {
- title: "",
- type: "",
- scenario: "",
- efficiency: "",
- problem: "",
- solution: "",
- keyPoints: "",
- creator: "",
- usageCount: 0,
- };
- equipmentname.value = "";
- statusname.value = "";
- }
-
- if (detailType.value != 1) {
- equipmentname.value =
- equipmentOptions.value.find(item => item.value === form.value.type)
- ?.name || "";
- statusname.value =
- statusOptions.value.find(item => item.value === form.value.efficiency)
- ?.name || "";
- }
- });
-</script>
-
-<style scoped lang="scss">
- @import "@/static/scss/form-common.scss";
- .client-visit {
- min-height: 100vh;
- background: #f8f9fa;
- padding-bottom: 5rem;
- }
-
- .footer-btns {
- position: fixed;
- left: 0;
- right: 0;
- bottom: 0;
- background: #fff;
- display: flex;
- justify-content: space-around;
- align-items: center;
- padding: 0.75rem 0;
- box-shadow: 0 -0.125rem 0.5rem rgba(0, 0, 0, 0.05);
- z-index: 1000;
- }
-
- .cancel-btn {
- font-weight: 400;
- font-size: 1rem;
- color: #666;
- background: #f5f5f5;
- border: 1px solid #ddd;
- width: 45%;
- height: 2.5rem;
- border-radius: 2.5rem 2.5rem 2.5rem 2.5rem;
- }
-
- .sign-btn {
- font-weight: 500;
- font-size: 1rem;
- color: #fff;
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- border: none;
- width: 45%;
- height: 2.5rem;
- border-radius: 2.5rem 2.5rem 2.5rem 2.5rem;
- }
-
- .location-icon {
- color: #1989fa;
- font-size: 1.2rem;
- }
-
- .selector-container {
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- height: 100%;
- }
-
- .selector-text {
- font-size: 14px;
- color: #333;
- }
-
- .popup-content {
- padding: 20rpx;
- }
-
- .popup-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- }
-
- .popup-title {
- font-size: 16px;
- font-weight: bold;
- color: #333;
- }
-
- .close-icon {
- font-size: 20px;
- color: #999;
- }
-
- .popup-body {
- max-height: 60vh;
- overflow-y: auto;
- margin-bottom: 20rpx;
- }
-
- .checkbox-item {
- margin-bottom: 15rpx;
- font-size: 14px;
- }
-
- .popup-footer {
- display: flex;
- justify-content: space-between;
- gap: 15rpx;
- }
-
- .cancel-btn-popup {
- flex: 1;
- border-radius: 8rpx;
- }
-
- .confirm-btn-popup {
- flex: 1;
- border-radius: 8rpx;
- }
- .checkbox-item {
- margin-top: 40rpx;
- }
-</style>
\ No newline at end of file
diff --git a/src/pages/works.vue b/src/pages/works.vue
index 89c8d26..964bd07 100644
--- a/src/pages/works.vue
+++ b/src/pages/works.vue
@@ -673,7 +673,7 @@
break;
case "鐭ヨ瘑搴�":
uni.navigateTo({
- url: "/pages/managementMeetings/knowledgeBase/index",
+ url: "/pages/cooperativeOffice/collaborativeApproval/knowledgeBase/index",
});
break;
case "鐢ㄥ嵃绠$悊":
--
Gitblit v1.9.3