update:预览优化
This commit is contained in:
@@ -14,12 +14,17 @@ const service = axios.create({
|
||||
});
|
||||
|
||||
const company = 'carsafe';
|
||||
const userId = $wujie?.props?.USER_ID || localStorage.getItem('USER_ID') || '';
|
||||
const token = $wujie?.props?.TOKEN || localStorage.getItem('TOKEN') || '';
|
||||
const tenantId = $wujie?.props?.TENANT_ID || localStorage.getItem('TENANT_ID') || '';
|
||||
let userId = $wujie?.props?.USER_ID || localStorage.getItem('USER_ID') || '';
|
||||
let token = $wujie?.props?.TOKEN || localStorage.getItem('TOKEN') || '';
|
||||
let tenantId = $wujie?.props?.TENANT_ID || localStorage.getItem('TENANT_ID') || '';
|
||||
|
||||
service.interceptors.request.use(
|
||||
(config) => {
|
||||
if (config.params?.token) {
|
||||
userId = config.params.userId;
|
||||
token = config.params.token;
|
||||
tenantId = config.params.tenantId;
|
||||
}
|
||||
config.headers['company'] = company;
|
||||
config.headers['jobNumber'] = userId;
|
||||
config.headers['token'] = token;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div v-if="fileId && type === 'onlyOffice'" class="content">
|
||||
<iframe
|
||||
class="iframe"
|
||||
:src="`${env.VITE_API_SPDM_URL}/onlyOffice?fileId=${fileId}&fileData=${fileData}&fileKey=${fileKey}`"
|
||||
:src="`${env.VITE_API_SPDM_URL}/onlyOffice?fileId=${fileId}&fileData=${fileData}&fileKey=${fileKey}&userId=${userId}&tenantId=${tenantId}&token=${token}`"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -39,6 +39,9 @@ const diaVisible = ref(false);
|
||||
const url = ref('');
|
||||
const fileData = ref<any>('');
|
||||
const fileKey = ref('fileKey');
|
||||
const userId = ref(localStorage.getItem('USER_ID'));
|
||||
const token = ref(localStorage.getItem('TOKEN'));
|
||||
const tenantId = ref(localStorage.getItem('TENANT_ID'));
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
|
||||
@@ -55,13 +55,13 @@
|
||||
</el-icon>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip :content="$t('表格.列表字段设置')" placement="top">
|
||||
<el-tooltip :content="$t('表格.列表字段设置')" placement="top">
|
||||
<div class="icon-btn" @click="formDiaVisible = true">
|
||||
<el-icon :size="18">
|
||||
<Setting />
|
||||
</el-icon>
|
||||
</div>
|
||||
</el-tooltip> -->
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
</el-icon>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip :content="$t('表格.列表字段设置')" placement="top">
|
||||
<el-tooltip :content="$t('表格.列表字段设置')" placement="top">
|
||||
<div class="icon-btn" @click="formDiaVisible = true">
|
||||
<el-icon :size="18">
|
||||
<Setting />
|
||||
</el-icon>
|
||||
</div>
|
||||
</el-tooltip> -->
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -46,12 +46,14 @@ const searchData = ref<any>({});
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
dirId: number;
|
||||
data: any;
|
||||
fileIds: any;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
modelValue: false,
|
||||
dirId: 0,
|
||||
data: {},
|
||||
fileIds: [],
|
||||
});
|
||||
|
||||
watch(
|
||||
@@ -66,10 +68,16 @@ const searchFun = async () => {
|
||||
if (valid) {
|
||||
const params = {
|
||||
...searchData.value,
|
||||
parentDirId: props.dirId,
|
||||
current: 1,
|
||||
size: 9999,
|
||||
};
|
||||
if (props.data.id) {
|
||||
params.parentDirId = props.data.id;
|
||||
params.fileIds = props.fileIds;
|
||||
} else {
|
||||
// 根目录
|
||||
params.dirType = 2;
|
||||
}
|
||||
dataOverViewSearchSimulationNodeFilesApi(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
emit('search', res.data);
|
||||
|
||||
@@ -194,7 +194,8 @@
|
||||
/>
|
||||
<FileSearch
|
||||
v-model="searchShow"
|
||||
:dirId="currentData.id"
|
||||
:data="currentData"
|
||||
:fileIds="tableParams.fileIds"
|
||||
@search="searchFileFun"
|
||||
@reset="resetSearchFileFun"
|
||||
/>
|
||||
@@ -672,7 +673,7 @@ const choseNodeFun = (mergeData: any) => {
|
||||
let data: any = {};
|
||||
if (mergeData.mergeSameNameChildren) {
|
||||
mergeDataList.value = mergeData.mergeSameNameChildren;
|
||||
mergeDataName.value = mergeDataList.value[0].totalName;
|
||||
// mergeDataName.value = mergeDataList.value[0].totalName;
|
||||
data = mergeDataList.value[0];
|
||||
} else {
|
||||
data = mergeData;
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
>
|
||||
<template #leftOptions>
|
||||
<div>
|
||||
<el-button type="primary" @click="batchEditClickFun" :disabled="chosenData.length === 0">批量修改</el-button>
|
||||
<el-button type="primary" @click="batchEditClickFun" :disabled="chosenData.length === 0">
|
||||
批量修改
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
@@ -43,44 +45,43 @@
|
||||
</template>
|
||||
</el-drawer> -->
|
||||
<!-- 编辑配置对话框 -->
|
||||
<Dialog
|
||||
v-model="editDialogVisible"
|
||||
diaTitle="修改配置"
|
||||
width="400"
|
||||
show-footer
|
||||
@closed="closeDialogFun"
|
||||
>
|
||||
<Dialog
|
||||
v-model="editDialogVisible"
|
||||
diaTitle="修改配置"
|
||||
width="400"
|
||||
show-footer
|
||||
@closed="closeDialogFun"
|
||||
>
|
||||
<template #default>
|
||||
<el-form :model="editform" label-width="auto">
|
||||
<el-form-item label="用户:" v-if="editType === 'single'">
|
||||
<el-input readonly class="w160" v-model="editform.userName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户初始存储:">
|
||||
<el-form-item label="用户存储上限:">
|
||||
<el-input class="w80 mr5" v-model="editform.quotaValue" type="number"></el-input>
|
||||
<el-select class="w80" v-model="editform.quotaUnit">
|
||||
<el-option
|
||||
v-for="item in unitList"
|
||||
:label="item"
|
||||
:value="item"
|
||||
:key="item"
|
||||
></el-option>
|
||||
<el-option v-for="item in unitList" :label="item" :value="item" :key="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button @click="editDialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button @click="editDialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="
|
||||
!editform.quotaValue ||
|
||||
( currentEditRow.quotaValueString.split(' ')[0] === editform.quotaValue && currentEditRow.quotaValueString.split(' ')[1] === editform.quotaUnit )"
|
||||
@click="batchEditFun"> 确定 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
|
||||
!editform.quotaValue ||
|
||||
(currentEditRow.quotaValueString.split(' ')[0] === editform.quotaValue &&
|
||||
currentEditRow.quotaValueString.split(' ')[1] === editform.quotaUnit)
|
||||
"
|
||||
@click="batchEditFun"
|
||||
>
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -88,7 +89,6 @@ import { ref, reactive, computed } from 'vue';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import { listUserQuotaApi, batchUpdateUserQuotaApi } from '@/api/data/data';
|
||||
import StatusDot from '@/components/common/statusDot/index.vue';
|
||||
import TableForm from '@/components/common/table/tableForm.vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
@@ -98,8 +98,7 @@ const { t } = useI18n();
|
||||
|
||||
const baseTableRef = ref();
|
||||
|
||||
const visible = ref(false);
|
||||
const tableFormRef = ref();
|
||||
// const visible = ref(false);
|
||||
const userName = ref('');
|
||||
const filterFormData = reactive<any>({
|
||||
userName: '',
|
||||
@@ -131,10 +130,9 @@ const actionList = computed(() => {
|
||||
});
|
||||
|
||||
// 新增配置的方法,暂时用不到
|
||||
const closeFun = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
const submitFun = () => {};
|
||||
// const closeFun = () => {
|
||||
// visible.value = false;
|
||||
// };
|
||||
|
||||
const searchFun = () => {
|
||||
userName.value = filterFormData.userName;
|
||||
@@ -166,24 +164,29 @@ const batchEditFun = async () => {
|
||||
ElMessage.warning('请填写正确的存储空间大小');
|
||||
return;
|
||||
}
|
||||
const params = editType.value === 'batch' ? chosenData.value.map((item: any) => {
|
||||
return {
|
||||
userId: item.userId,
|
||||
quotaValue: editform.value.quotaValue,
|
||||
quotaUnit: editform.value.quotaUnit,
|
||||
};
|
||||
}) : [{
|
||||
userId: currentEditRow.value?.userId,
|
||||
quotaValue: editform.value.quotaValue,
|
||||
quotaUnit: editform.value.quotaUnit,
|
||||
}];
|
||||
const params =
|
||||
editType.value === 'batch'
|
||||
? chosenData.value.map((item: any) => {
|
||||
return {
|
||||
userId: item.userId,
|
||||
quotaValue: editform.value.quotaValue,
|
||||
quotaUnit: editform.value.quotaUnit,
|
||||
};
|
||||
})
|
||||
: [
|
||||
{
|
||||
userId: currentEditRow.value?.userId,
|
||||
quotaValue: editform.value.quotaValue,
|
||||
quotaUnit: editform.value.quotaUnit,
|
||||
},
|
||||
];
|
||||
|
||||
const res: any = await batchUpdateUserQuotaApi(params);
|
||||
if (res && res.code === 200) {
|
||||
ElMessage.success('修改成功');
|
||||
searchFun();
|
||||
editDialogVisible.value = false;
|
||||
}
|
||||
const res: any = await batchUpdateUserQuotaApi(params);
|
||||
if (res && res.code === 200) {
|
||||
ElMessage.success('修改成功');
|
||||
searchFun();
|
||||
editDialogVisible.value = false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -7,9 +7,14 @@ import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import OnlyOffiece from '@/components/common/onlyOffice/index.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const data: any = route.query.fileData || '{}';
|
||||
const fileId = ref(route.query.fileId);
|
||||
const fileKey = ref(route.query.fileKey);
|
||||
const route: any = useRoute();
|
||||
const { query } = route;
|
||||
const data: any = query.fileData || '{}';
|
||||
const fileId = ref(query.fileId);
|
||||
const fileKey = ref(query.fileKey);
|
||||
const fileData = ref(JSON.parse(data));
|
||||
|
||||
localStorage.setItem('USER_ID', query.userId);
|
||||
localStorage.setItem('TOKEN', query.token);
|
||||
localStorage.setItem('TENANT_ID', query.tenantId);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user