文案编辑 数据仓完善
Signed-off-by: liubp <1535785116@qq.com>
| New file |
| | |
| | | import { MockMethod } from 'vite-plugin-mock'; |
| | | import { resultSuccess, baseUrl } from '../_util'; |
| | | |
| | | // 模拟语义词列表数据 |
| | | const semanticWordList = [ |
| | | { |
| | | id: '1', |
| | | word: '品牌力第一证明机构推荐', |
| | | startDate: '2024-01-01', |
| | | endDate: '2024-12-31', |
| | | ranking: '1', |
| | | category: '品牌', |
| | | status: 'active', |
| | | remark: '品牌力相关语义词', |
| | | changer: 'admin' |
| | | }, |
| | | { |
| | | id: '2', |
| | | word: '行业领先技术', |
| | | startDate: '2024-01-01', |
| | | endDate: '2024-12-31', |
| | | ranking: '2', |
| | | category: '技术', |
| | | status: 'active', |
| | | remark: '技术相关语义词', |
| | | changer: 'admin' |
| | | }, |
| | | { |
| | | id: '3', |
| | | word: '优质服务保障', |
| | | startDate: '2024-01-01', |
| | | endDate: '2024-12-31', |
| | | ranking: '3', |
| | | category: '服务', |
| | | status: 'active', |
| | | remark: '服务相关语义词', |
| | | changer: 'admin' |
| | | }, |
| | | { |
| | | id: '4', |
| | | word: '创新解决方案', |
| | | startDate: '2024-01-01', |
| | | endDate: '2024-12-31', |
| | | ranking: '4', |
| | | category: '创新', |
| | | status: 'active', |
| | | remark: '创新相关语义词', |
| | | changer: 'admin' |
| | | }, |
| | | { |
| | | id: '5', |
| | | word: '专业团队支持', |
| | | startDate: '2024-01-01', |
| | | endDate: '2024-12-31', |
| | | ranking: '5', |
| | | category: '团队', |
| | | status: 'active', |
| | | remark: '团队相关语义词', |
| | | changer: 'admin' |
| | | } |
| | | ]; |
| | | |
| | | export default [ |
| | | { |
| | | url: `${baseUrl}/semanticword/semanticWord/list`, |
| | | timeout: 1000, |
| | | method: 'get', |
| | | response: () => { |
| | | return resultSuccess({ |
| | | records: semanticWordList, |
| | | total: semanticWordList.length, |
| | | size: 10, |
| | | current: 1, |
| | | pages: 1, |
| | | }); |
| | | }, |
| | | }, |
| | | ] as MockMethod[]; |
| | |
| | | import {defHttp} from '/@/utils/http/axios'; |
| | | import { useMessage } from "/@/hooks/web/useMessage"; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | |
| | | |
| | | const { createConfirm } = useMessage(); |
| | | const userStore = useUserStore(); |
| | | const userInfo = userStore.getUserInfo; |
| | | const isAdmin = userStore.getUserInfo?.id === 'e9ca23d68d884d4ebb19d07889727dae'; |
| | | const currentUserId = userInfo?.id || ''; |
| | | |
| | | |
| | | enum Api { |
| | | list = '/copywriting/copywriting/list', |
| | |
| | | */ |
| | | export const list = (params) => |
| | | defHttp.get({url: Api.list, params}); |
| | | // export const list = (params) => { |
| | | // console.log('currentUserId',currentUserId) |
| | | // console.log('list',list) |
| | | // const finalParams = isAdmin ? params : { ...params, changer: currentUserId }; |
| | | // console.log('接口层最终参数:', finalParams); // 验证参数 |
| | | // return defHttp.get({ url: Api.list, params: finalParams }); // 传最终参数 |
| | | // }; |
| | | |
| | | /** |
| | | * 删除单个 |
| | |
| | | align:"center", |
| | | dataIndex: 'title' |
| | | }, |
| | | // { |
| | | // title: '内容', |
| | | // align:"center", |
| | | // dataIndex: 'text' |
| | | // }, |
| | | { |
| | | title: '开始时间', |
| | | align:"center", |
| | |
| | | align:"center", |
| | | dataIndex: 'status_dictText' |
| | | }, |
| | | // { |
| | | // title: '审核时间', |
| | | // align:"center", |
| | | // dataIndex: 'auditTime' |
| | | // }, |
| | | // { |
| | | // title: '审核人员', |
| | | // align:"center", |
| | | // dataIndex: 'auditer' |
| | | // }, |
| | | { |
| | | title: '驳回原因', |
| | | align:"center", |
| | | dataIndex: 'remark' |
| | | }, |
| | | // { |
| | | // title: '推荐平台', |
| | | // align:"center", |
| | | // dataIndex: 'platform' |
| | | // }, |
| | | { |
| | | title: '预定排名', |
| | | align:"center", |
| | |
| | | <BasicTable @register="registerTable" :rowSelection="rowSelection"> |
| | | <!--插槽:table标题--> |
| | | <template #tableTitle> |
| | | <a-button type="primary" v-auth="'copywriting:copywriting:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> |
| | | <j-upload-button type="primary" v-auth="'copywriting:copywriting:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> |
| | | <!-- <a-button type="primary" v-auth="'copywriting:copywriting:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> |
| | | <j-upload-button type="primary" v-auth="'copywriting:copywriting:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> --> |
| | | |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <template #overlay> |
| | |
| | | const router = useRouter(); |
| | | //注册model |
| | | const [registerModal, {openModal}] = useModal(); |
| | | // 获取用户store |
| | | //注册table数据 |
| | | const { tableContext,onExportXls,onImportXls } = useListPage({ |
| | | const { tableContext,onExportXls:_onExportXls,onImportXls:_onImportXls } = useListPage({ |
| | | tableProps:{ |
| | | title: '文案', |
| | | api: list, |
| | |
| | | } |
| | | } |
| | | } |
| | | return Object.assign(params, queryParam); |
| | | const finalParams = Object.assign(params, queryParam); |
| | | return finalParams; |
| | | }, |
| | | }, |
| | | exportConfig: { |
| | |
| | | }); |
| | | reload(); |
| | | } |
| | | /** |
| | | * 新增事件 |
| | | */ |
| | | function handleAdd() { |
| | | openModal(true, { |
| | | isUpdate: false, |
| | | showFooter: true, |
| | | }); |
| | | } |
| | | // /** |
| | | // * 新增事件 |
| | | // */ |
| | | // function handleAdd() { |
| | | // openModal(true, { |
| | | // isUpdate: false, |
| | | // showFooter: true, |
| | | // }); |
| | | // } |
| | | /** |
| | | * 编辑事件 - 跳转到下载页面 |
| | | */ |
| | |
| | | } |
| | | ] |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | |
| | | <template> |
| | | <div class="chart-container"> |
| | | <div class="word-display">{{ outWord }}</div> |
| | | <div class="chart-header">实时排名检测</div> |
| | | <div ref="chartRef" class="echart"></div> |
| | | </div> |
| | |
| | | <script setup lang="ts"> |
| | | import { ref, onMounted, watch } from 'vue'; |
| | | import * as echarts from 'echarts'; // 引入 ECharts |
| | | import { list } from '/@/views/semanticwordPD/SemanticWord.api'; |
| | | |
| | | const chartRef = ref<HTMLDivElement | null>(null); // 绑定 DOM 容器 |
| | | const outWord = ref(''); // 存储接口返回的outWord |
| | | |
| | | // 定义props接收图表数据 |
| | | // 定义props接收图表数据和选中的语义词 |
| | | const props = defineProps<{ |
| | | chartData?: { |
| | | xAxis: string[]; |
| | | series: number[]; |
| | | }; |
| | | selectedSemanticWord?: string; |
| | | }>(); |
| | | |
| | | let myChart: echarts.ECharts | null = null; // ECharts 实例 |
| | | |
| | | // 根据选中的语义词获取对应的outWord |
| | | const fetchOutWordBySemanticWord = async (semanticWord: string) => { |
| | | if (!semanticWord) { |
| | | outWord.value = '请选择语义词'; |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | const response = await list({ word: semanticWord }); |
| | | console.log('根据语义词获取数据响应:', response); |
| | | |
| | | // 从接口返回的数据中提取outWord |
| | | if (response && response.records && Array.isArray(response.records)) { |
| | | // 查找与选中语义词匹配的记录 |
| | | const matchedRecord = response.records.find(record => record.word === semanticWord); |
| | | if (matchedRecord && matchedRecord.outWord) { |
| | | outWord.value = matchedRecord.outWord; |
| | | } else { |
| | | outWord.value = '暂无露出词'; |
| | | } |
| | | } else { |
| | | outWord.value = '暂无数据'; |
| | | } |
| | | } catch (error) { |
| | | console.error('获取语义词语列表失败:', error); |
| | | outWord.value = '获取数据失败'; |
| | | } |
| | | }; |
| | | |
| | | // 组件挂载后初始化图表 |
| | | onMounted(() => { |
| | | initChart(); |
| | | // 如果已经有选中的语义词,则获取对应的outWord |
| | | if (props.selectedSemanticWord) { |
| | | fetchOutWordBySemanticWord(props.selectedSemanticWord); |
| | | } else { |
| | | outWord.value = '请选择语义词'; |
| | | } |
| | | }); |
| | | |
| | | // 监听选中的语义词变化 |
| | | watch(() => props.selectedSemanticWord, (newSemanticWord) => { |
| | | if (newSemanticWord) { |
| | | fetchOutWordBySemanticWord(newSemanticWord); |
| | | } else { |
| | | outWord.value = '请选择语义词'; |
| | | } |
| | | }); |
| | | |
| | | // 初始化 ECharts |
| | |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .word-display { |
| | | text-align: center; |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | color: #333; |
| | | margin-bottom: 10px; |
| | | padding: 8px 0; |
| | | background: #f0f8ff; |
| | | border-radius: 4px; |
| | | border: 1px solid #d1e7ff; |
| | | } |
| | | |
| | | .chart-header { |
| | | align-self: flex-end; |
| | | background: #0099ff; |
| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref, onMounted, watch } from 'vue'; |
| | | import { list } from '/@/views/semanticword/SemanticWord.api'; |
| | | import { getRobinList } from '/@/api/demo/robin.api'; |
| | | import { list } from '/@/views/semanticwordPD/SemanticWord.api'; |
| | | |
| | | // 定义props |
| | | const props = defineProps<{ |
| | | word?: string; |
| | | cardIndex?: number; // 卡片索引,用于区分显示哪个test字段 |
| | | contractPeriod: string; // 签约期限 |
| | | signRank: number; // 签约排名 |
| | | avgRank: number; // 平均排名 |
| | |
| | | }>(); |
| | | |
| | | // 响应式数据 |
| | | const semanticWords = ref<any[]>([]); |
| | | const displayWord = ref<string>(''); |
| | | const outWord = ref<string>(''); // 存储露出词 |
| | | |
| | | // 从接口获取语义词数据 |
| | | const fetchSemanticWords = async () => { |
| | | // 根据语义词获取对应的露出词 |
| | | const fetchOutWordBySemanticWord = async (semanticWord: string) => { |
| | | if (!semanticWord) { |
| | | outWord.value = '吾德研究'; // 默认露出词 |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | const response = await list({}); |
| | | console.log('语义词接口返回:', response); |
| | | const response = await list({ word: semanticWord }); |
| | | console.log('根据语义词获取数据响应:', response); |
| | | |
| | | // 根据实际API返回结构调整 |
| | | semanticWords.value = response.records || response.list || response || []; |
| | | |
| | | // 如果有语义词数据,显示第一个语义词的word字段 |
| | | if (semanticWords.value.length > 0) { |
| | | const firstWord = semanticWords.value[0].word; |
| | | displayWord.value = firstWord || '默认语义词'; |
| | | console.log('设置显示语义词:', displayWord.value); |
| | | // 从接口返回的数据中提取outWord |
| | | if (response && response.records && Array.isArray(response.records)) { |
| | | // 查找与选中语义词匹配的记录 |
| | | const matchedRecord = response.records.find(record => record.word === semanticWord); |
| | | if (matchedRecord && matchedRecord.outWord) { |
| | | outWord.value = matchedRecord.outWord; |
| | | } else { |
| | | outWord.value = '吾德研究'; // 默认露出词 |
| | | } |
| | | } else { |
| | | displayWord.value = props.word || '暂无语义词'; |
| | | outWord.value = '吾德研究'; // 默认露出词 |
| | | } |
| | | } catch (error) { |
| | | console.error('获取语义词数据失败:', error); |
| | | displayWord.value = props.word || '获取失败'; |
| | | console.error('获取语义词语列表失败:', error); |
| | | outWord.value = '吾德研究'; // 默认露出词 |
| | | } |
| | | }; |
| | | |
| | | // 从robin接口获取test字段数据 |
| | | const fetchRobinTestData = async () => { |
| | | try { |
| | | const response = await getRobinList({ |
| | | sFromLLM: 'deepseek', // 默认使用deepseek |
| | | sBookMarkName: outWord.value, // 使用动态获取的露出词 |
| | | sKeyword: props.word || '品牌力第一证明机构' // 使用传入的语义词或默认值 |
| | | }); |
| | | |
| | | console.log('robin接口返回:', response); |
| | | |
| | | // 根据实际API返回结构提取test字段 |
| | | if (response && Array.isArray(response)) { |
| | | const cardIndex = props.cardIndex || 0; |
| | | |
| | | // 根据卡片索引获取对应位置的test字段 |
| | | if (response[cardIndex] && response[cardIndex].test !== undefined) { |
| | | displayWord.value = response[cardIndex].test; |
| | | console.log(`卡片${cardIndex}显示test字段:`, displayWord.value); |
| | | } else { |
| | | displayWord.value = '暂无test数据'; |
| | | } |
| | | } else { |
| | | displayWord.value = '暂无数据'; |
| | | } |
| | | } catch (error) { |
| | | console.error('获取robin数据失败:', error); |
| | | displayWord.value = '获取失败'; |
| | | } |
| | | }; |
| | | |
| | | // 监听props.word的变化 |
| | | watch(() => props.word, (newVal) => { |
| | | if (newVal) { |
| | | displayWord.value = newVal; |
| | | // 当语义词变化时,先获取对应的露出词,然后重新获取robin数据 |
| | | fetchOutWordBySemanticWord(newVal).then(() => { |
| | | fetchRobinTestData(); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 组件挂载时获取数据 |
| | | onMounted(() => { |
| | | if (!props.word) { |
| | | fetchSemanticWords(); |
| | | if (props.word) { |
| | | // 如果有语义词,先获取对应的露出词,然后获取robin数据 |
| | | fetchOutWordBySemanticWord(props.word).then(() => { |
| | | fetchRobinTestData(); |
| | | }); |
| | | } else { |
| | | displayWord.value = props.word; |
| | | // 如果没有语义词,直接获取robin数据(使用默认露出词) |
| | | fetchRobinTestData(); |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | <div class="card-item" v-for="(cardData, index) in cardDataList" :key="index"> |
| | | <div class="card-content"> |
| | | <StatsCard |
| | | :word="selectedSemanticWord" |
| | | :card-index="index" |
| | | :contract-period="cardData.contractPeriod" |
| | | :sign-rank="cardData.signRank" |
| | | :avg-rank="cardData.avgRank" |
| | |
| | | :accept-rate="cardData.acceptRate" |
| | | :achieved-rate="cardData.achievedRate" |
| | | /> |
| | | <RankingChart :chart-data="cardData.chartData" /> <!-- 柱状图 --> |
| | | <RankingChart :chart-data="cardData.chartData" :selected-semantic-word="selectedSemanticWord" /> <!-- 柱状图 --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref, onMounted } from 'vue'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | import { getBrandChartData } from '/@/api/demo/robin.api'; |
| | | import { semanticWordListApi } from '/@/api/demo/businessApi'; |
| | | import StatsCard from './StatsCard.vue'; |
| | | import RankingChart from './RankingChart.vue'; |
| | | |
| | | // 获取用户store |
| | | const userStore = useUserStore(); |
| | | |
| | | const semanticWords = ref<Array<{ value: string; label: string }>>([]); // 语义词列表(value=label=sBookMarkName) |
| | | const selectedSemanticWord = ref(''); // 选中的语义词(值为sBookMarkName) |
| | |
| | | xAxis: ['10-01', '10-02', '10-03', '10-04', '10-05', '10-06', '10-07'], |
| | | series: [2, 2, 3, 3, 3, 1, 2], |
| | | } |
| | | }, |
| | | { |
| | | contractPeriod: '2025-10-08-2026-10-07', |
| | | signRank: 1, |
| | | avgRank: 1, |
| | | onlineDate: '2025-10-08', |
| | | acceptRate: 92, |
| | | achievedRate: 98, |
| | | chartData: { |
| | | xAxis: ['10-01', '10-02', '10-03', '10-04', '10-05', '10-06', '10-07'], |
| | | series: [1, 1, 1, 1, 1, 1, 1], |
| | | } |
| | | }, |
| | | { |
| | | contractPeriod: '2025-10-08-2026-10-07', |
| | | signRank: 4, |
| | | avgRank: 4, |
| | | onlineDate: '2025-10-08', |
| | | acceptRate: 82, |
| | | achievedRate: 90, |
| | | chartData: { |
| | | xAxis: ['10-01', '10-02', '10-03', '10-04', '10-05', '10-06', '10-07'], |
| | | series: [3, 3, 4, 4, 4, 2, 3], |
| | | } |
| | | }, |
| | | { |
| | | contractPeriod: '2025-10-08-2026-10-07', |
| | | signRank: 5, |
| | | avgRank: 5, |
| | | onlineDate: '2025-10-08', |
| | | acceptRate: 78, |
| | | achievedRate: 85, |
| | | chartData: { |
| | | xAxis: ['10-01', '10-02', '10-03', '10-04', '10-05', '10-06', '10-07'], |
| | | series: [4, 4, 5, 5, 5, 3, 4], |
| | | } |
| | | } |
| | | ]); |
| | | |
| | | //语义词选择框 - 从/semanticword/semanticWord/list outWord获取露出词数据 |
| | | //语义词选择框 - 从/semanticword/semanticWord/list word获取语义词数据 |
| | | const fetchSemanticWords = async () => { |
| | | isLoadingSemanticWords.value = true; |
| | | try { |
| | |
| | | |
| | | // 根据接口返回的数据结构处理数据 |
| | | if (response && response.records && Array.isArray(response.records)) { |
| | | // 从records中提取露出词(outWord)数据 - 使用类型断言处理接口返回数据 |
| | | const records = response.records as any[]; |
| | | const outWords = records |
| | | .filter(item => item.outWord && item.outWord.trim() !== '') // 过滤掉空值 |
| | | .map(item => item.outWord) |
| | | .filter((outWord, index, array) => array.indexOf(outWord) === index); // 去重 |
| | | // 从records中提取语义词(word)数据 |
| | | const words = response.records |
| | | .filter(item => item.word && item.word.trim() !== '') // 过滤掉空值 |
| | | .map(item => item.word) |
| | | .filter((word, index, array) => array.indexOf(word) === index); // 去重 |
| | | |
| | | console.log('提取的露出词列表:', outWords); |
| | | console.log('提取的语义词列表:', words); |
| | | |
| | | if (outWords.length > 0) { |
| | | semanticWords.value = outWords.map(outWord => ({ |
| | | value: outWord, |
| | | label: outWord, |
| | | if (words.length > 0) { |
| | | semanticWords.value = words.map(word => ({ |
| | | value: word, |
| | | label: word, |
| | | })); |
| | | |
| | | if (semanticWords.value.length > 0) { |
| | |
| | | |
| | | // 页面加载时初始化数据 |
| | | onMounted(() => { |
| | | // 获取当前登录用户ID并打印到控制台 |
| | | const userInfo = userStore.getUserInfo; |
| | | if (userInfo && userInfo.id) { |
| | | console.log('当前登录用户ID:', userInfo.id); |
| | | console.log('用户信息:', userInfo); |
| | | } else { |
| | | console.log('未获取到用户信息,用户可能未登录'); |
| | | } |
| | | |
| | | fetchSemanticWords(); // 获取语义词列表 |
| | | handleTabClick(currentTab.value); |
| | | }); |
| | |
| | | field: 'customerPhone', |
| | | component: 'Input', |
| | | label: '客户电话', |
| | | required: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入客户电话', |
| | | }, |
| | | { |
| | | pattern: /^1[3-9]\d{9}$/, |
| | | message: '请输入正确的手机号码格式', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | field: 'customerEmail', |
| | | component: 'Input', |
| | | label: '客户邮箱', |
| | | required: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入客户邮箱', |
| | | }, |
| | | { |
| | | pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, |
| | | message: '请输入正确的邮箱格式', |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | |
| | | import {defHttp} from '/@/utils/http/axios'; |
| | | import { useMessage } from "/@/hooks/web/useMessage"; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | |
| | | const { createConfirm } = useMessage(); |
| | | const userStore = useUserStore(); |
| | | const isAdmin = userStore.getUserInfo?.username === 'admin'; |
| | | const currentCreateBy = userStore.getUserInfo?.username || ''; |
| | | |
| | | enum Api { |
| | | list = '/semanticword/semanticWord/list', |
| | |
| | | * 列表接口 |
| | | * @param params |
| | | */ |
| | | export const list = (params) => |
| | | defHttp.get({url: Api.list, params}); |
| | | // export const list = (params) => |
| | | // defHttp.get({url: Api.list, params:params}); |
| | | export const list = (params) => { |
| | | // 手动添加createBy(非管理员时) |
| | | const finalParams = isAdmin ? params : { ...params, createBy: currentCreateBy }; |
| | | console.log('接口层最终参数:', finalParams); // 验证参数 |
| | | return defHttp.get({ url: Api.list, params: finalParams }); // 传最终参数 |
| | | }; |
| | | |
| | | /** |
| | | * 删除单个 |
| | |
| | | import {BasicColumn} from '/@/components/Table'; |
| | | import {FormSchema} from '/@/components/Table'; |
| | | import { rules} from '/@/utils/helper/validator'; |
| | | import { render } from '/@/utils/common/renderUtils'; |
| | | import { getWeekMonthQuarterYear } from '/@/utils'; |
| | | //列表数据 |
| | | export const columns: BasicColumn[] = [ |
| | | { |
| | |
| | | <template #tableTitle> |
| | | <!-- 显示当前用户权限状态 --> |
| | | <a-alert |
| | | v-if="!isSuperAdmin" |
| | | v-if="!isAdmin" |
| | | type="info" |
| | | :message="`当前用户:${currentUser?.username || '未知'}(仅显示自己创建的数据)`" |
| | | show-icon |
| | |
| | | <a-alert |
| | | v-else |
| | | type="success" |
| | | message="当前用户:admin(超级管理员,可查看所有数据)" |
| | | message="当前用户:admin(管理员,可查看所有数据)" |
| | | show-icon |
| | | style="display: inline-block; margin-right: 16px;" |
| | | /> |
| | |
| | | |
| | | // 获取当前用户信息 |
| | | const currentUser = computed(() => userStore.getUserInfo); |
| | | |
| | | // 判断是否为超级管理员(通过用户名判断) |
| | | const isSuperAdmin = computed(() => { |
| | | return currentUser.value?.username === 'admin'; |
| | | |
| | | // 判断是否为管理员(通过用户名判断) |
| | | const isAdmin = computed(() => { |
| | | return currentUser.value.username === 'admin'; |
| | | }); |
| | | |
| | | // 获取当前用户的创建人标识 |
| | | const currentCreateBy = computed(() => { |
| | | return currentUser.value?.username || ''; |
| | | |
| | | // 获取当前用户的ID |
| | | const currentUserId = computed(() => { |
| | | return currentUser.value.id || ''; |
| | | }); |
| | | |
| | | console.log('currentUser.value.id',currentUser.value.id) |
| | | // 合同文件选择相关状态 |
| | | const contractFiles = ref<any[]>([]); |
| | | const selectedContractIds = ref<string[]>([]); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 权限判断:如果不是超级管理员,则添加createBy过滤条件 |
| | | if (!isSuperAdmin.value && currentCreateBy.value) { |
| | | params = { |
| | | ...params, |
| | | createBy: currentCreateBy.value |
| | | }; |
| | | } |
| | | |
| | | return Object.assign(params, queryParam); |
| | | const finalParams = Object.assign(params, queryParam); |
| | | return finalParams; |
| | | }, |
| | | }, |
| | | exportConfig: { |
| | | name:"语义词", |
| | | url: getExportUrl, |
| | | params: queryParam, |
| | | params: { |
| | | ...queryParam, |
| | | // 权限判断:如果不是超级管理员,则添加changer过滤条件 |
| | | ...(!isAdmin.value && currentUserId.value ? { creatBy: currentUserId.value } : {}) |
| | | }, |
| | | }, |
| | | importConfig: { |
| | | url: getImportUrl, |
| | |
| | | // 获取合同文件列表 |
| | | const response = await getContractFilesApi(); |
| | | console.log("合同文件接口返回:", response); // 调试日志 |
| | | |
| | | // 显示API返回的完整信息用于调试 |
| | | console.log("API返回数据结构:", { |
| | | records: response.records, |
| | | list: response.list, |
| | | total: response.total, |
| | | size: response.size, |
| | | current: response.current, |
| | | pages: response.pages |
| | | }); |
| | | |
| | | // 真实API返回的是records字段,而不是list |
| | | contractFiles.value = response.records || response.list || []; |
| | |
| | | } |
| | | ] |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | import {defHttp} from '/@/utils/http/axios'; |
| | | import { useMessage } from "/@/hooks/web/useMessage"; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | |
| | | |
| | | const { createConfirm } = useMessage(); |
| | | // const userStore = useUserStore(); |
| | | // const userStore = useUserStore(); |
| | | // const isAdmin = userStore.getUserInfo?.username === 'admin'; |
| | | // const currentCreateBy = userStore.getUserInfo?.username || ''; |
| | | // const userInfo = userStore.getUserInfo; |
| | | // const isAdmin = userStore.getUserInfo?.id === 'e9ca23d68d884d4ebb19d07889727dae'; |
| | | // const currentUserId = userInfo?.id || ''; |
| | | |
| | | enum Api { |
| | | list = '/semanticword/semanticWord/list', |
| | |
| | | */ |
| | | export const list = (params) => |
| | | defHttp.get({url: Api.list, params}); |
| | | // export const list = (params) => { |
| | | // // 手动添加createBy(非管理员时) |
| | | // const finalParams = isAdmin ? params : { ...params, createBy: currentCreateBy }; |
| | | // console.log('接口层最终参数:', finalParams); // 验证参数 |
| | | // return defHttp.get({ url: Api.list, params: finalParams }); // 传最终参数 |
| | | // }; |
| | | |
| | | /** |
| | | * 删除单个 |
| | |
| | | } |
| | | } |
| | | } |
| | | return Object.assign(params, queryParam); |
| | | const finalParams = Object.assign(params, queryParam); |
| | | return finalParams; |
| | | }, |
| | | }, |
| | | exportConfig: { |
| | |
| | | import {defHttp} from '/@/utils/http/axios'; |
| | | import { useMessage } from "/@/hooks/web/useMessage"; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | |
| | | |
| | | const { createConfirm } = useMessage(); |
| | | const userStore = useUserStore(); |
| | | const isAdmin = userStore.getUserInfo?.id === 'e9ca23d68d884d4ebb19d07889727dae'; |
| | | const currentCreateBy = userStore.getUserInfo?.id || ''; |
| | | |
| | | enum Api { |
| | | list = '/semanticword/semanticWord/list', |
| | |
| | | * 列表接口 |
| | | * @param params |
| | | */ |
| | | export const list = (params) => |
| | | defHttp.get({url: Api.list, params}); |
| | | // export const list = (params) => |
| | | // defHttp.get({url: Api.list, params}); |
| | | export const list = (params) => { |
| | | console.log('currentCreateBy',currentCreateBy) |
| | | const finalParams = isAdmin ? params : { ...params, changer: currentCreateBy }; |
| | | console.log('接口层最终参数:', finalParams); // 验证参数 |
| | | return defHttp.get({ url: Api.list, params: finalParams }); // 传最终参数 |
| | | }; |
| | | |
| | | /** |
| | | * 删除单个 |
| | |
| | | { |
| | | title: '语义词', |
| | | align:"center", |
| | | dataIndex: 'word' |
| | | dataIndex: 'word', |
| | | width: 300 |
| | | }, |
| | | { |
| | | title: '签约名次', |
| | | align:"center", |
| | | dataIndex: 'ranking' |
| | | dataIndex: 'ranking', |
| | | width: 100 |
| | | }, |
| | | |
| | | { |
| | | title: '开始时间', |
| | | align:"center", |
| | | dataIndex: 'startDate' |
| | | dataIndex: 'startDate', |
| | | width: 200 |
| | | }, |
| | | { |
| | | title: '结束时间', |
| | | align:"center", |
| | | dataIndex: 'endDate' |
| | | dataIndex: 'endDate', |
| | | width: 200 |
| | | }, |
| | | { |
| | | title: '提交时间', |
| | | align:"center", |
| | | dataIndex: 'createTime' |
| | | dataIndex: 'createTime', |
| | | width: 200 |
| | | }, |
| | | ]; |
| | | //查询数据 |
| | |
| | | } |
| | | } |
| | | } |
| | | return Object.assign(params, queryParam); |
| | | const finalParams = Object.assign(params, queryParam); |
| | | return finalParams; |
| | | }, |
| | | }, |
| | | exportConfig: { |