21819 2 years ago
parent
commit
b06d719421
  1. 10
      src/components/FileList.vue
  2. 3
      src/components/LeaderSelect.vue
  3. 1
      src/components/PoliceSelect.vue
  4. 3
      src/components/Upload.vue
  5. 2
      src/layout/components/Aside.vue
  6. 2
      src/permission.ts
  7. 2
      src/stores/modules/multipleTabs.ts
  8. 5
      src/utils/request.ts
  9. 22
      src/utils/socket.ts
  10. 3
      src/views/work/components/AddMail.vue
  11. 10
      src/views/work/components/MailDialog.vue
  12. 60
      src/views/work/components/MailReturn.vue
  13. 7
      src/views/work/components/MailReturnDetail.vue

10
src/components/FileList.vue

@ -73,7 +73,7 @@
</template>
<template v-else-if="activeFile.type.indexOf('word') > -1">
<vue-office-docx
:src="`${VITE_API_URL}/api/file/stream/${activeFile.filepath}`"
:src="getDocFilepath()"
style="height: 100vh; width: 900px"
@error="fileRrror = true"
v-if="!fileRrror"
@ -211,6 +211,14 @@ function remove(index) {
function download() {
window.open(`${VITE_API_URL}/api/file/stream/${activeFile.value.filepath}`);
}
function getDocFilepath() {
if (activeFile.value.type === 'application/msword' && activeFile.value.docxFilepath) {
return `${VITE_API_URL}/api/file/stream/${activeFile.value.docxFilepath}`
}
return `${VITE_API_URL}/api/file/stream/${activeFile.value.filepath}`
}
</script>
<style lang="scss" scoped>
.file-container {

3
src/components/LeaderSelect.vue

@ -33,8 +33,6 @@ function handleSelect(val) {
const leaders = ref([]);
console.log('leaderType', props.leaderType)
function getLeaders() {
getLeaderList(props.leaderType).then((data) => {
leaders.value = data;
@ -44,7 +42,6 @@ getLeaders();
watch(
() => props.leaderType,
() => {
console.log('watch leaderType', props.leaderType)
getLeaders();
}
);

1
src/components/PoliceSelect.vue

@ -45,7 +45,6 @@ function remoteMethod(query) {
}
function handleChange(empNo) {
console.log(options.value.filter(item => item.empNo === empNo)[0])
emit('update:data', options.value.filter(item => item.empNo === empNo)[0])
emit('select')
}

3
src/components/Upload.vue

@ -73,7 +73,8 @@ function handleSuccess(data, file) {
filepath: data.data.filepath,
orgiinFilename: file.name,
type: file.raw.type,
size: file.size
size: file.size,
docxFilepath: data.data.docxFilepath
});
emit("update:modelValue", files.value);
}

2
src/layout/components/Aside.vue

@ -92,9 +92,7 @@ function handleAsideCollapse() {
const active = ref(-1);
function handleMenuClick(route, index) {
active.value = index;
console.log(route);
if (route.meta.type === "C") {
console.log(route.name);
if (route.path === "/datascreen") {
const url = router.resolve({ path: "/datascreen/" }).href;
window.open(url, "_blank");

2
src/permission.ts

@ -76,7 +76,7 @@ router.beforeEach(async (to, from, next) => {
}
}
} else {
next({ path: loginPath, query: { redirect: to.fullPath } })
next({ path: loginPath })
}
})

2
src/stores/modules/multipleTabs.ts

@ -45,7 +45,7 @@ const findTabsIndex = (fullPath: string, tabList: TabItem[]) => {
}
const getComponentName = (route: RouteLocationNormalized) => {
return route.matched.at(-1)?.components?.default?.name
return route.matched[route.matched.length - 1]?.components?.default?.name
}
export const getRouteParams = (tabItem: TabItem) => {

5
src/utils/request.ts

@ -82,6 +82,11 @@ function ajax(url: string, options: Options) {
} else {
let message = res.msg;
if (res.code === 401) {
if (url === '/system/admin/self') {
feedback.msgError('登录状态已过期')
reject(res)
return
}
if (!isRelogin) {
isRelogin = true
ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '温馨提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {

22
src/utils/socket.ts

@ -17,21 +17,6 @@ let connetStatus = false;
*/
export const initSocket = () => {
con();
// setInterval(() => {
// //根据连接状态
// if (connetStatus) {
// try {
// //发送请求
// stompClient.send(
// "/xterm/con",
// header,
// JSON.stringify({ name: "test" })
// );
// } catch (error) {
// con();
// }
// }
// }, 10000);
};
/**
*
@ -47,27 +32,23 @@ export const con = () => {
header,
() => {
const userStore = useUserStore();
console.log('userStore', userStore.userInfo)
let topic = "/topic";
if (userStore.userInfo.roleId === 1 || userStore.userInfo.roleId === 2 || userStore.userInfo.roleId === 3) {
topic += `/role/${userStore.userInfo.roleId}/${userStore.userInfo.dataDeptId}`
} else {
topic += `/user/${userStore.userInfo.empNo}`
}
console.log("topic", topic);
connetStatus = true;
// 设置订阅
stompClient.subscribe(topic,
(res: any) => {
console.log('topic', res);
emitter.emit("notice");
},
header
);
},
(err: any) => {
console.log("error");
console.log(err);
console.error(err);
}
);
};
@ -78,7 +59,6 @@ export const con = () => {
export const close = () => {
if (stompClient) {
stompClient.disconnect(() => {
console.log("============connect release============");
connetStatus = false;
});
}

3
src/views/work/components/AddMail.vue

@ -233,9 +233,6 @@ const rules = reactive<FormRules<FormData>>({
contactName: [
{ required: true, message: "请输入姓名" },
],
contactIdCard: [
{ required: true, validator: validatorIdCard },
],
contactPhone: [
{ required: true, validator: validatorPhone },
],

10
src/views/work/components/MailDialog.vue

@ -391,11 +391,12 @@
@submit="(key) => handleAction(key)"
/>
<MailReturen
v-model:show="returnShow"
<MailReturn
v-model="returnShow"
v-model:data="requestData"
:mail="mail"
@submit="(key) => handleAction(key)"
@close="returnShow = false"
/>
<ApplyExtension
@ -430,7 +431,7 @@ import ApplicationCompleted from "./ApplicationCompleted.vue";
import ReviewComments from "./ReviewComments.vue";
import ConfirmedCompletion from "./ConfirmedCompletion.vue";
import InitiateCountersign from "./InitiateCountersign.vue";
import MailReturen from "./MailReturen.vue";
import MailReturn from "./MailReturn.vue";
import ApplyExtension from "./ApplyExtension.vue";
import ExtensionApprovalReturn from "./ExtensionApprovalReturn.vue";
@ -934,8 +935,9 @@ footer {
}
.content {
font-size: 16px;
padding: 10px;
padding: 8px;
color: #333;
white-space: pre-wrap;
}
.file-box {

60
src/views/work/components/MailReturen.vue → src/views/work/components/MailReturn.vue

@ -1,5 +1,5 @@
<template>
<el-dialog v-model="visible" width="50vw" title="信件退回">
<el-dialog width="50vw" title="信件退回">
<el-form
label-position="top"
:model="form"
@ -25,11 +25,12 @@
v-model="form.reason"
type="textarea"
:rows="3"
placeholder="请输入退回原因"
:placeholder="showReturnAttachments() ? '请写明信件涉及的具体机构以及退回原因' : '请填写退回整改原因'"
></el-input>
</el-form-item>
<p>请写明信件涉及的具体机构</p>
<el-form-item label="附件" prop="attachments" v-if="showReturnAttachments()">
<Upload v-model="form.attachments" />
</el-form-item>
</el-form>
<footer class="flex end">
<el-button type="primary" size="large" @click="submit"
@ -39,7 +40,6 @@
</el-dialog>
</template>
<script setup>
const visible = ref(false);
const form = reactive({});
const rules = {
returnOperate: [
@ -58,10 +58,6 @@ const rules = {
const formRef = ref();
const props = defineProps({
show: {
type: Boolean,
default: false,
},
data: {
type: Object,
default: {},
@ -71,40 +67,18 @@ const props = defineProps({
default: {},
},
});
const selectLeaderVisible = ref(false);
const leaderType = ref("all");
watch(
() => props.flowKey,
(val) => {
if (val === "second_approval" || val === "second_deputy_approval") {
selectLeaderVisible.value = true;
leaderType.value =
val === "second_deputy_approval" ? "leader" : "deputy";
}
if (val === "second_approval") {
leaderType.value = "deputy";
}
if (val === "second_deputy_approval") {
leaderType.value = "leader";
}
}
);
onMounted(() => {
if (props.data) {
Object.assign(form, props.data);
}
});
const emits = defineEmits(["update:show", "update:data", "submit"]);
watch(visible, (val) => {
emits("update:show", val);
});
watch(
() => props.show,
(val) => {
visible.value = val;
}
);
watch(() => props.mail.id, () => {
formRef.value?.resetFields();
form.attachments = []
})
const emits = defineEmits(["update:data", "submit", "close"]);
const flowKeys = ['second_sign', 'second_distribute', 'three_sign']
function showReturnAttachments() {
return flowKeys.indexOf(props.mail.flowKey) > -1;
}
function submit() {
formRef.value.validate((valid) => {
@ -113,7 +87,7 @@ function submit() {
const data = { ...props.data, ...form };
emits("update:data", data);
emits("submit", "returnSubmit");
visible.value = false;
emits("close");
}
});
}

7
src/views/work/components/MailReturnDetail.vue

@ -14,6 +14,10 @@
<label class="mt-8">退回理由</label>
<div class="content">{{ mailReturns[0].reason }}</div>
</div>
<div class="col mt-16" v-if="JSON.parse(mailReturns[0].attachments)">
<label class="mt-8">附件</label>
<FileList :files="JSON.parse(mailReturns[0].attachments)" />
</div>
</div>
</template>
<script setup>
@ -32,6 +36,9 @@ watch(
);
</script>
<style lang="scss" scoped>
.col label {
width: 60px;
}
.box {
border: 1px solid #ffe3e3;
padding: 16px;

Loading…
Cancel
Save