Merge pull request 'fix/updatesyspic' (#208) from fix/updatesyspic into test

Reviewed-on: #208
pull/212/head
刘释隆 1 year ago
commit c9282047ec

@ -39,5 +39,10 @@
"jsonc", "jsonc",
"yaml" "yaml"
], ],
"vue3snippets.enable-compile-vue-file-on-did-save-code": true "vue3snippets.enable-compile-vue-file-on-did-save-code": true,
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"[vue]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"editor.formatOnSaveMode": "modifications"
} }

32
components.d.ts vendored

@ -10,49 +10,17 @@ declare module 'vue' {
Application: typeof import('./src/components/Application/Application.vue')['default'] Application: typeof import('./src/components/Application/Application.vue')['default']
BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default'] BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default']
DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default']
NAvatar: typeof import('naive-ui')['NAvatar']
NBackTop: typeof import('naive-ui')['NBackTop']
NButton: typeof import('naive-ui')['NButton'] NButton: typeof import('naive-ui')['NButton']
NCard: typeof import('naive-ui')['NCard']
NCheckbox: typeof import('naive-ui')['NCheckbox'] NCheckbox: typeof import('naive-ui')['NCheckbox']
NCollapse: typeof import('naive-ui')['NCollapse']
NCollapseItem: typeof import('naive-ui')['NCollapseItem']
NConfigProvider: typeof import('naive-ui')['NConfigProvider'] NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDatePicker: typeof import('naive-ui')['NDatePicker']
NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDialogProvider: typeof import('naive-ui')['NDialogProvider']
NDivider: typeof import('naive-ui')['NDivider']
NDropdown: typeof import('naive-ui')['NDropdown']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NEmpty: typeof import('naive-ui')['NEmpty']
NForm: typeof import('naive-ui')['NForm'] NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem'] NFormItem: typeof import('naive-ui')['NFormItem']
NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid']
NGridItem: typeof import('naive-ui')['NGridItem']
NImage: typeof import('naive-ui')['NImage']
NInput: typeof import('naive-ui')['NInput'] NInput: typeof import('naive-ui')['NInput']
NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NMessageProvider: typeof import('naive-ui')['NMessageProvider']
NModal: typeof import('naive-ui')['NModal'] NModal: typeof import('naive-ui')['NModal']
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
NotPassed: typeof import('./src/components/NotPassed.vue')['default'] NotPassed: typeof import('./src/components/NotPassed.vue')['default']
NPopconfirm: typeof import('naive-ui')['NPopconfirm']
NPopover: typeof import('naive-ui')['NPopover']
NPopselect: typeof import('naive-ui')['NPopselect']
NProgress: typeof import('naive-ui')['NProgress']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSelect: typeof import('naive-ui')['NSelect']
NSlider: typeof import('naive-ui')['NSlider']
NSpace: typeof import('naive-ui')['NSpace']
NSpin: typeof import('naive-ui')['NSpin']
NSwitch: typeof import('naive-ui')['NSwitch']
NTabPane: typeof import('naive-ui')['NTabPane']
NTabs: typeof import('naive-ui')['NTabs']
NTag: typeof import('naive-ui')['NTag']
NTimeline: typeof import('naive-ui')['NTimeline']
NTimelineItem: typeof import('naive-ui')['NTimelineItem']
NTooltip: typeof import('naive-ui')['NTooltip']
NUpload: typeof import('naive-ui')['NUpload']
NUploadDragger: typeof import('naive-ui')['NUploadDragger']
Quill: typeof import('./src/components/RichEditor/Quill.vue')['default'] Quill: typeof import('./src/components/RichEditor/Quill.vue')['default']
Robot: typeof import('./src/components/Robot/index.vue')['default'] Robot: typeof import('./src/components/Robot/index.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -13,12 +13,14 @@ import { viewOptions } from '@/config/home'
import NotPassed from '@/components/Approval/NotPassed.vue' import NotPassed from '@/components/Approval/NotPassed.vue'
import { formatToDateHMS } from '@/utils/dateUtil' import { formatToDateHMS } from '@/utils/dateUtil'
import { off, on } from '@/utils/domUtils' import { off, on } from '@/utils/domUtils'
import bgLoading from '@/assets/images/bg-loading.png'
const cardStyle = { const cardStyle = {
'--n-padding-bottom': '40px', '--n-padding-bottom': '40px',
'--n-padding-left': '120px', '--n-padding-left': '120px',
} }
const bgLoadingImg = ref(bgLoading)
let startTime = 0 let startTime = 0
let endTime = 0 let endTime = 0
let startCalTime = false let startCalTime = false
@ -732,6 +734,7 @@ watch(() => pagination.pageNo, (newVal, oldVal) => {
ref="imageRef" ref="imageRef"
:src="item.imgUrl" :src="item.imgUrl"
:preview-src="item.imgUrl" :preview-src="item.imgUrl"
:fallback-src="bgLoadingImg"
class="img " class="img "
:class="{ :class="{
'img-fit': viewMode === 'horizontalVersion', 'img-fit': viewMode === 'horizontalVersion',

@ -11,88 +11,90 @@ import { useMessage, useDialog } from "naive-ui";
import { audit } from "@/api/task/task"; import { audit } from "@/api/task/task";
import NotPassed from "@/components/Approval/NotPassed.vue"; import NotPassed from "@/components/Approval/NotPassed.vue";
import { RepeatModal, RepeatTaskTableModal } from "../comp"; import { RepeatModal, RepeatTaskTableModal } from "../comp";
const dialog = useDialog();
const message = useMessage(); const emit = defineEmits(['changeShow'])
const router = useRouter(); const dialog = useDialog()
const notPassModalRef = ref(null); // const message = useMessage()
const sortorder = ref("asc"); const router = useRouter()
const sortname = ref("states"); const notPassModalRef = ref(null) //
const loading = ref(true); const sortorder = ref('asc')
const total = ref(0); const sortname = ref('states')
const scrollContainer = ref(null); const loading = ref(true)
const tableData = ref<any>([]); const total = ref(0)
const finalStore = useFinal(); const scrollContainer = ref(null)
const tableData = ref<any>([])
let num = 1; const finalStore = useFinal()
let num = 1
const pagination = reactive({ const pagination = reactive({
page: 1, page: 1,
pageCount: 20, pageCount: 20,
pageSize: 20, pageSize: 20,
}); })
const repeatModalRef = ref(null); const repeatModalRef = ref(null)
const repeatTaskTableModalRef = ref(null); const repeatTaskTableModalRef = ref(null)
const selectionIds = ref([]); const selectionIds = ref([])
const showActions = computed(() => { const showActions = computed(() => {
return selectionIds.value.length; return selectionIds.value.length
}); })
const emit = defineEmits(["changeShow"]);
function handleCheck(row: any, showcheck: any) { function handleCheck(row: any, showcheck: any) {
if (showcheck == false) { if (showcheck == false) {
console.log(tableData.value); console.log(tableData.value)
tableData.value.map((item) => { tableData.value.forEach((item) => {
if (item.length > 0) { if (item.length > 0) {
item.map((itemx, index) => { item.forEach((itemx, index) => {
if (row.id == itemx.id) { if (row.id == itemx.id)
itemx.showcheck = true; itemx.showcheck = true
}
//newlistx.push(itemx) // newlistx.push(itemx)
}); })
} }
}); })
selectionIds.value.push(row); selectionIds.value.push(row)
} else { }
tableData.value.map((item) => { else {
tableData.value.forEach((item) => {
if (item.length > 0) { if (item.length > 0) {
item.map((itemx, index) => { item.forEach((itemx, index) => {
if (row.id == itemx.id) { if (row.id == itemx.id)
itemx.showcheck = false; itemx.showcheck = false
}
//newlistx.push(itemx) // newlistx.push(itemx)
}); })
} }
}); })
selectionIds.value.pop(row); selectionIds.value.pop(row)
} }
} }
function switchBatch() { function switchBatch() {
tableData.value.map((item) => { tableData.value.forEach((item) => {
item.map((itemx, index) => { item.forEach((itemx, index) => {
itemx.showcheck = false; itemx.showcheck = false
}); })
}); })
selectionIds.value = []; selectionIds.value = []
} }
function changeContent() { function changeContent() {
emit("changeShow"); emit('changeShow')
}
function initRem() {
const designWidth = 1440
const rempPx = 16
const scale = window.innerWidth / designWidth
document.documentElement.style.fontSize = `${scale * rempPx}px`
} }
const initRem = () => {
const designWidth = 1440;
const rempPx = 16;
const scale = window.innerWidth / designWidth;
document.documentElement.style.fontSize = scale * rempPx + "px";
};
async function initData( async function initData(
page: number, page: number,
pageSize: number, pageSize: number,
filterId?: any, filterId?: any,
taskName?: string taskName?: string,
) { ) {
const asideParmas = unref(finalStore.getAsideValue); const asideParmas = unref(finalStore.getAsideValue)
// 使使 // 使使
// let params = filterId ? { userSearchId: filterId } : asideParmas // let params = filterId ? { userSearchId: filterId } : asideParmas
let params = asideParmas; let params = asideParmas
params = params?.izshowall ? {} : params; params = params?.izshowall ? {} : params
const result = await getFinalList({ const result = await getFinalList({
sortorder: sortorder.value, sortorder: sortorder.value,
@ -112,28 +114,28 @@ async function initData(
pagination.page = page; pagination.page = page;
pagination.pageCount = Math.ceil(totalCount / pageSize); pagination.pageCount = Math.ceil(totalCount / pageSize);
loading.value = false; loading.value = false;
tableData.value.map((item) => { tableData.value.forEach((item) => {
item.showcheck = false; item.showcheck = false;
if (isValidTimestamp(item.fromuptime)) { if (isValidTimestamp(item.fromuptime)) {
item.fromuptime = formatToDateHMS(item.fromuptime); item.fromuptime = formatToDateHMS(item.fromuptime);
} }
}); });
tableData.value = chunk(tableData.value, 4); tableData.value = chunk(tableData.value, 4)
} }
async function query( async function query(
page: number, page: number,
pageSize: number, pageSize: number,
filterId?: any, filterId?: any,
taskName?: string taskName?: string,
) { ) {
console.log("query", taskName); console.log('query', taskName)
const asideParmas = unref(finalStore.getAsideValue); const asideParmas = unref(finalStore.getAsideValue)
// 使使 // 使使
// let params = filterId ? { userSearchId: filterId } : asideParmas // let params = filterId ? { userSearchId: filterId } : asideParmas
let params = asideParmas; let params = asideParmas
params = params?.izshowall ? {} : params; params = params?.izshowall ? {} : params
const result = await getFinalList({ const result = await getFinalList({
sortorder: sortorder.value, sortorder: sortorder.value,
@ -143,151 +145,154 @@ async function query(
taskName, taskName,
isFail: true, isFail: true,
...params, ...params,
}); })
const { data, pageCount, totalCount } = result; const { data, pageCount, totalCount } = result
//console.log(data, pageCount, totalCount); // console.log(data, pageCount, totalCount);
let newlist = []; const newlist = []
let oldlist = tableData.value; const oldlist = tableData.value
if (oldlist.length > 0) { if (oldlist.length > 0) {
oldlist.map((item) => { oldlist.forEach((item) => {
// console.log(item); // console.log(item);
if (item.length > 0) { if (item.length > 0) {
item.map((itemx: any) => { item.forEach((itemx: any) => {
itemx.showcheck = false; itemx.showcheck = false
newlist.push(itemx); newlist.push(itemx)
}); })
} }
}); })
data.map((item) => { data.forEach((item) => {
item.showcheck = false; item.showcheck = false
newlist.push(item); newlist.push(item)
}); })
} else {
data.map((item) => {
item.showcheck = false;
newlist.push(item);
});
} }
//tableData.value = tableData.value.concat(data); else {
tableData.value = newlist; data.forEach((item) => {
item.showcheck = false
newlist.push(item)
})
}
// tableData.value = tableData.value.concat(data);
tableData.value = newlist
// console.log(tableData.value); // console.log(tableData.value);
total.value = totalCount; total.value = totalCount;
pagination.page = page; pagination.page = page;
pagination.pageCount = Math.ceil(totalCount / pageSize); pagination.pageCount = Math.ceil(totalCount / pageSize);
loading.value = false; loading.value = false;
tableData.value.map((item) => { tableData.value.forEach((item) => {
if (isValidTimestamp(item.fromuptime)) { if (isValidTimestamp(item.fromuptime)) {
item.fromuptime = formatToDateHMS(item.fromuptime); item.fromuptime = formatToDateHMS(item.fromuptime);
} }
}); });
tableData.value = chunk(tableData.value, 4); tableData.value = chunk(tableData.value, 4)
} }
function isValidTimestamp(value) { function isValidTimestamp(value) {
if (typeof value !== "number" || !Number.isInteger(value)) { if (typeof value !== 'number' || !Number.isInteger(value))
return false; // return false //
}
const date = new Date(value); const date = new Date(value)
return !isNaN(date.getTime()); // return !Number.isNaN(date.getTime()) //
} }
// //
function goDetail(row) { function goDetail(row) {
router.push({ router.push({
name: "final-detail", name: 'final-detail',
query: { id: row.id, packageid: row.packageid }, query: { id: row.id, packageid: row.packageid },
}); })
} }
// //
function repeatBatchReject(items) { function repeatBatchReject(items) {
console.log(items); console.log(items)
rejectHandler(items); rejectHandler(items)
} }
// //
function rejectHandler(list) { function rejectHandler(list) {
console.log(list); console.log(list)
const msg = validate(list); const msg = validate(list)
if (msg !== null) { if (msg !== null) {
message.error(msg); message.error(msg)
return; return
} }
function validate(items: any[]) { function validate(items: any[]) {
if (items.length === 0) return "至少选中一个任务"; if (items.length === 0)
return null; return '至少选中一个任务'
return null
} }
console.log(notPassModalRef); console.log(notPassModalRef)
const modal = unref(notPassModalRef)! as any; const modal = unref(notPassModalRef)! as any
modal.showModal(list); modal.showModal(list)
} }
function showModal(modalRef: any) { function showModal(modalRef: any) {
const modal = unref(modalRef)! as any; const modal = unref(modalRef)! as any
modal.showModal(); modal.showModal()
} }
onMounted(() => { onMounted(() => {
initRem(); initRem()
initData(1, 20); initData(1, 20)
}); })
const item = { const item = {
img: testImg, img: testImg,
checked: false, checked: false,
title: "YP45678", title: 'YP45678',
date: "2023-12-19 12:09:18", date: '2023-12-19 12:09:18',
}; }
const data = ref<any[]>([]); const data = ref<any[]>([])
function actionHandler(action: any, row: any) { function actionHandler(action: any, row: any) {
const { key } = action; const { key } = action
switch (key) { switch (key) {
case "view": case 'view':
goDetail(row); goDetail(row)
break; break
case "reset": case 'reset':
// resetHandler() // resetHandler()
break; break
case "approval": case 'approval':
singleApproval(row); singleApproval(row)
break; break
case "reject": case 'reject':
rejectHandler(row); rejectHandler(row)
break; break
default: default:
break; break
} }
} }
// //
function doAudit(param: any, row: any) { function doAudit(param: any, row: any) {
dialog.info({ dialog.info({
title: "确认提示", title: '确认提示',
content: "确认给该任务审批为【通过】吗?", content: '确认给该任务审批为【通过】吗?',
positiveText: "确定", positiveText: '确定',
negativeText: "取消", negativeText: '取消',
onPositiveClick: () => { onPositiveClick: () => {
audit(param).then((res) => { audit(param).then((res) => {
const { code } = res; const { code } = res
if (code === "OK") { if (code === 'OK') {
message.success(res.message); message.success(res.message)
//changecardstatus(3, row); // changecardstatus(3, row);
initData(1, 20); initData(1, 20)
num = 1; num = 1
reload(); reload()
} else { }
message.error(res.message); else {
message.error(res.message)
} }
}); })
}, },
onNegativeClick: () => {}, onNegativeClick: () => {},
}); })
} }
// //
function singleApproval(row) { function singleApproval(row) {
console.log(row); console.log(row)
const param = { const param = {
result: true, result: true,
comment: "", comment: '',
disposeType: "", disposeType: '',
disposeTypeId: "", disposeTypeId: '',
failCauseId: "", failCauseId: '',
failCauseName: "", failCauseName: '',
flowTaskInfoList: [ flowTaskInfoList: [
{ {
formId: row.id, formId: row.id,
@ -295,102 +300,104 @@ function singleApproval(row) {
taskName: row.fromTaskName, taskName: row.fromTaskName,
}, },
], ],
}; }
doAudit(param, row); doAudit(param, row)
} }
// //
function batchApproval() { function batchApproval() {
const items: any = selectionIds.value; const items: any = selectionIds.value
const msg = validate(items); const msg = validate(items)
function validate(items: any[]) { function validate(items: any[]) {
if (items.length === 0) return "至少选中一个任务"; if (items.length === 0)
return null; return '至少选中一个任务'
return null
} }
if (msg !== null) { if (msg !== null) {
message.error(msg); message.error(msg)
return; return
} }
console.log(items); console.log(items)
const list: any = []; const list: any = []
items.forEach((item) => { items.forEach((item) => {
list.push({ list.push({
formId: item.id, formId: item.id,
taskId: item.taskId, taskId: item.taskId,
taskName: item.fromtaskname, taskName: item.fromtaskname,
}); })
}); })
const param = { const param = {
result: true, result: true,
comment: "", comment: '',
disposeType: "", disposeType: '',
disposeTypeId: "", disposeTypeId: '',
failCauseId: "", failCauseId: '',
failCauseName: "", failCauseName: '',
flowTaskInfoList: list, flowTaskInfoList: list,
}; }
doAudit(param, {}); doAudit(param, {})
selectionIds.value = []; selectionIds.value = []
num = 1; num = 1
} }
// //
function batchReject() { function batchReject() {
const items: any = selectionIds.value; const items: any = selectionIds.value
rejectHandler(items); rejectHandler(items)
selectionIds.value = []; selectionIds.value = []
num = 1; num = 1
} }
// //
function changecardstatus(states, item) { function changecardstatus(states, item) {
//let index = tableData.value.findIndex(itemx => itemx.id === item.id); // let index = tableData.value.findIndex(itemx => itemx.id === item.id);
let newlist = []; const newlist = []
tableData.value.map((itemarr, indexarr) => { tableData.value.forEach((itemarr, indexarr) => {
itemarr.map((itemobj, indexobj) => { itemarr.forEach((itemobj, indexobj) => {
if (item.id == itemobj.id) { if (item.id == itemobj.id)
itemobj.states = states; itemobj.states = states
}
newlist.push(itemobj); newlist.push(itemobj)
}); })
}); })
tableData.value = chunk(newlist, 4); tableData.value = chunk(newlist, 4)
} }
function reload() { function reload() {
//query(1, 20) // query(1, 20)
//num=1 // num=1
//selectionIds.value = [] // selectionIds.value = []
//checkedRowKeys.value = [] // checkedRowKeys.value = []
// const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps // const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps
// query(page!, pageSize!) // query(page!, pageSize!)
} }
let debounceTimer; let debounceTimer
// //
function checkBottom() { function checkBottom() {
const container = scrollContainer.value; const container = scrollContainer.value
// console.log(1) // console.log(1)
if (!container) return; if (!container)
return
// const { scrollTop, clientHeight, scrollHeight } = container; // const { scrollTop, clientHeight, scrollHeight } = container;
const scrollTop = window.pageYOffset || document.documentElement.scrollTop; const scrollTop = window.pageYOffset || document.documentElement.scrollTop
// //
const clientHeight = const clientHeight
window.innerHeight || document.documentElement.clientHeight; = window.innerHeight || document.documentElement.clientHeight
// //
const scrollHeight = document.documentElement.scrollHeight; const scrollHeight = document.documentElement.scrollHeight
clearTimeout(debounceTimer); clearTimeout(debounceTimer)
debounceTimer = setTimeout(() => { debounceTimer = setTimeout(() => {
if (scrollTop + clientHeight >= scrollHeight - 10) { if (scrollTop + clientHeight >= scrollHeight - 10) {
num = num + 1; num = num + 1
console.log(num); console.log(num)
query(num, 20); query(num, 20)
// fetchData(); // // fetchData(); //
} }
}, 500); }, 500)
} }
function changesort(sortnamex) { function changesort(sortnamex) {
if (sortorder.value == "asc" && sortnamex == "submit_date_timestamp") { if (sortorder.value == "asc" && sortnamex == "submit_date_timestamp") {
@ -470,18 +477,17 @@ defineExpose({
src="@/assets/images/task/btn-not-pass.png" src="@/assets/images/task/btn-not-pass.png"
alt="" alt=""
@click.stop="batchReject" @click.stop="batchReject"
/> >
<SvgIcon size="24" name="vs" /> <SvgIcon size="24" name="vs" />
<img <img
class="btn-approval" class="btn-approval"
src="@/assets/images/task/btn-pass.png" src="@/assets/images/task/btn-pass.png"
alt="" alt=""
@click.stop="batchApproval" @click.stop="batchApproval"
/> >
</div> </div>
<n-popover <n-popover
ref="popover"
:style="{ padding: '0px' }" :style="{ padding: '0px' }"
style="width: 148px" style="width: 148px"
:show-arrow="false" :show-arrow="false"
@ -495,26 +501,20 @@ defineExpose({
</template> </template>
<ul class="wrapper-header-action"> <ul class="wrapper-header-action">
<li @click="importHandler"> <li @click="importHandler">
<SvgIcon size="20" name="import" /><span style="margin-left: 5px" <SvgIcon size="20" name="import" /><span style="margin-left: 5px">批量导入数据</span>
>批量导入数据</span
>
</li> </li>
<li @click="exportHandler"> <li @click="exportHandler">
<SvgIcon size="20" name="download" /><span <SvgIcon size="20" name="download" /><span
style="margin-left: 5px" style="margin-left: 5px"
>导出待审数据</span >导出待审数据</span>
>
</li> </li>
<li> <li>
<SvgIcon size="20" name="download" /><span <SvgIcon size="20" name="download" /><span
style="margin-left: 5px" style="margin-left: 5px"
>导出全部数据</span >导出全部数据</span>
>
</li> </li>
<li> <li>
<SvgIcon size="20" name="look" /><span style="margin-left: 5px" <SvgIcon size="20" name="look" /><span style="margin-left: 5px">查看导入记录</span>
>查看导入记录</span
>
</li> </li>
</ul> </ul>
</n-popover> </n-popover>
@ -522,7 +522,7 @@ defineExpose({
</div> </div>
<div class="header_data"> <div class="header_data">
<DataHeader :hasColor="true" /> <DataHeader :has-color="true" />
</div> </div>
<div class="wrapper-settings"> <div class="wrapper-settings">
<div> <div>
@ -551,49 +551,49 @@ defineExpose({
</div> </div>
<div :class="tableData.length>16?'cotnet_wrapeer':'cotnet_wrapeertwo'" @scroll="checkBottom" ref="scrollContainer"> <div :class="tableData.length>16?'cotnet_wrapeer':'cotnet_wrapeertwo'" @scroll="checkBottom" ref="scrollContainer">
<div <div
class="data_wrapper"
v-for="(sitem, sindex) in tableData" v-for="(sitem, sindex) in tableData"
:key="sindex" :key="sindex"
class="data_wrapper"
:style=" :style="
sitem.length == 1 sitem.length == 1
? { width: '25%' } ? { width: '25%' }
: sitem.length == 2 : sitem.length == 2
? { width: '50%' } ? { width: '50%' }
: sitem.length == 3 : sitem.length == 3
? { width: '75%' } ? { width: '75%' }
: {} : {}
" "
> >
<div <div
class="item"
v-for="(item, index) in sitem" v-for="(item, index) in sitem"
:key="index" :key="index"
class="item"
:style=" :style="
sitem.length == 1 sitem.length == 1
? { margin: '0 4% 0 4%' } ? { margin: '0 4% 0 4%' }
: sitem.length == 2 : sitem.length == 2
? { margin: '0 2% 0 2%' } ? { margin: '0 2% 0 2%' }
: sitem.length == 3 : sitem.length == 3
? { margin: '0 1.2% 0 1.2%' } ? { margin: '0 1.2% 0 1.2%' }
: {} : {}
" "
> >
<div class="top"> <div class="top">
<div <div
@click="goDetail(item)"
class="img" class="img"
:style=" :style="
item.serverThumbnailUrl != null item.serverThumbnailUrl != null
? `background:url(${item.serverThumbnailUrl});background-size:100% 100%;background-repeat: no-repeat;` ? `background:url(${item.serverThumbnailUrl});background-size:100% 100%;background-repeat: no-repeat;`
: `background:url(${item.imgUrl});background-size:100% 100%;background-repeat: no-repeat;` : `background:url(${item.imgUrl});background-size:100% 100%;background-repeat: no-repeat;`
" "
></div> @click="goDetail(item)"
<div class="check_box" v-show="item.states == 2"> />
<div v-show="item.states == 2" class="check_box">
<n-checkbox <n-checkbox
size="medium" size="medium"
label=" " label=" "
@click="handleCheck(item, item.showcheck)"
:checked="item.showcheck" :checked="item.showcheck"
@click="handleCheck(item, item.showcheck)"
/> />
</div> </div>
<div class="content" @click="goDetail(item)"> <div class="content" @click="goDetail(item)">
@ -609,17 +609,17 @@ defineExpose({
</div> </div>
<div class="tag_box"> <div class="tag_box">
<div <div
class="tag_item"
v-for="index in 2" v-for="index in 2"
:key="index" :key="index"
class="tag_item"
:style=" :style="
index == 2 || item.states == 3 index == 2 || item.states == 3
? 'color:#02C984' ? 'color:#02C984'
: item.states == 2 : item.states == 2
? 'color: #fe9800;background:#f7eac075' ? 'color: #fe9800;background:#f7eac075'
: item.states == 5 : item.states == 5
? 'color:#FF4E4F;background:#f7c0c06b' ? 'color:#FF4E4F;background:#f7c0c06b'
: 'color:#02C984' : 'color:#02C984'
" "
> >
{{ {{
@ -627,10 +627,10 @@ defineExpose({
? item.states == 3 ? item.states == 3
? "通过" ? "通过"
: item.states == 2 : item.states == 2
? "待审核" ? "待审核"
: item.states == 5 : item.states == 5
? "未通过" ? "未通过"
: "" : ""
: item.fromusername : item.fromusername
}} }}
</div> </div>
@ -638,24 +638,24 @@ defineExpose({
</div> </div>
</div> </div>
<div class="bottom"> <div class="bottom">
<!-- <div class="reset_action">重置审批</div>--> <!-- <div class="reset_action">重置审批</div> -->
<div <div
class="resovle_action"
v-show="item.states != 2" v-show="item.states != 2"
class="resovle_action"
@click="goDetail(item)" @click="goDetail(item)"
> >
查看 查看
</div> </div>
<div <div
class="resovle_action"
v-show="item.states == 2" v-show="item.states == 2"
class="resovle_action"
@click="actionHandler({ key: 'approval' }, item)" @click="actionHandler({ key: 'approval' }, item)"
> >
通过 通过
</div> </div>
<div <div
class="reject_action"
v-show="item.states == 2" v-show="item.states == 2"
class="reject_action"
@click="actionHandler({ key: 'reject' }, [item])" @click="actionHandler({ key: 'reject' }, [item])"
> >
不通过 不通过

File diff suppressed because it is too large Load Diff

@ -33,6 +33,7 @@ import { useUser } from '@/store/modules/user'
import { isEmpty } from '@/utils' import { isEmpty } from '@/utils'
import { formatToDateHMS } from '@/utils/dateUtil' import { formatToDateHMS } from '@/utils/dateUtil'
import { hideDownload } from '@/utils/image' import { hideDownload } from '@/utils/image'
import bgLoading from '@/assets/images/bg-loading.png'
const emit = defineEmits(['setAsideItemName']) const emit = defineEmits(['setAsideItemName'])
@ -59,6 +60,8 @@ const sortBy: any = {
orderName: 'similarityScore', orderName: 'similarityScore',
} }
const el = ref<HTMLDivElement | null>(null) const el = ref<HTMLDivElement | null>(null)
const bgLoadingImg = ref(bgLoading)
const pagination = reactive({ const pagination = reactive({
pageNo: 0, pageNo: 0,
pageSize: 30, pageSize: 30,
@ -411,7 +414,7 @@ async function getTableData() {
'拜访项目类别', '拜访项目类别',
] ]
fieldList.map((v) => { fieldList.forEach((v) => {
if (userFieldList.includes(v.name)) { if (userFieldList.includes(v.name)) {
let locationobj = { address: '' } let locationobj = { address: '' }
if (v.name == 'location') { if (v.name == 'location') {
@ -803,20 +806,23 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') {
isFullScreen isFullScreen
? imgbigshow ? imgbigshow
? { ? {
'position': 'relative', position: 'relative',
//width: '70vw', //width: '70vw',
'flex': 1, flex: 1,
// flex: 0.75, // flex: 0.75,
'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, // 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`,
background: `url(${taskDetailInfo?.ocrPicture?.imgurl}), url(${bgLoadingImg})`,
} }
: { : {
'height': '92vh', height: '92vh',
'flex': 1, flex: 1,
'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, // 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`,
background: `url(${taskDetailInfo?.ocrPicture?.imgurl}), url(${bgLoadingImg})`,
} }
: { : {
'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, // 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`,
background: `url(${taskDetailInfo?.ocrPicture?.imgurl}), url(${bgLoadingImg})`,
} }
" "
@mouseover="overTaskHandle" @mouseover="overTaskHandle"
@ -993,7 +999,8 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') {
<div <div
class="img-wrapper" class="img-wrapper"
:style="{ :style="{
'background-image': `url(${item.serverThumbnailUrl})`, // 'background-image': `url(${item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl})`,
background: `url(${item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl}), url(${bgLoadingImg})`,
}" }"
/> />
<div class="small-mark" /> <div class="small-mark" />
@ -1218,7 +1225,8 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') {
<div <div
class="img-wrapper" class="img-wrapper"
:style="{ :style="{
'background-image': `url(${item.serverThumbnailUrl})`, // 'background-image': `url(${item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl})`,
background: `url(${item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl}), url(${bgLoadingImg})`,
}" }"
@mouseover="overTaskHandelr(item)" @mouseover="overTaskHandelr(item)"
@mouseleave="leaveTaskHandler" @mouseleave="leaveTaskHandler"

@ -254,18 +254,15 @@ function afterLeave() {
onMounted(() => { onMounted(() => {
show.value && addListeners() show.value && addListeners()
window.addEventListener("keydown", handleKeydown); window.addEventListener('keydown', handleKeydown)
}) })
// //
function handleKeydown(event) { function handleKeydown(event) {
// //
if (event.keyCode === 67) { if (event.keyCode === 67)
show.value=false show.value = false
// batchModalRef.value.closeModal() // batchModalRef.value.closeModal()
}
} }
function showModal(value) { function showModal(value) {
taskId.value = value taskId.value = value
@ -408,7 +405,8 @@ const gridHeight = computed(() => {
defineExpose({ defineExpose({
showModal, showModal,
reload,closeModal reload,
closeModal,
}) })
</script> </script>
@ -544,40 +542,39 @@ defineExpose({
:style="{ height: gridHeight }" :style="{ height: gridHeight }"
class="grid-item" class="grid-item"
> >
<n-image <n-image
ref="imageRef" class="img"
class="img"
:class="{ :class="{
'img-fit': viewMode === 'horizontalVersion', 'img-fit': viewMode === 'horizontalVersion',
'img-full': viewMode === '3:4' || viewMode === 'verticalVersion', 'img-full': viewMode === '3:4' || viewMode === 'verticalVersion',
}" }"
:src="item.serverThumbnailUrl" :src="item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl"
/> />
<div class="small-mark" /> <div class="small-mark" />
<div class="time"> <div class="time">
<div v-if="item.photoDateTimestamp" class="time-item"> <div v-if="item.photoDateTimestamp" class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="14" name="camera-time" /> <SvgIcon class="svg-time" color="#FFF" size="14" name="camera-time" />
<span>{{ formatToDateHMS(Number(item.photoDateTimestamp) || 0) }}</span> <span>{{ formatToDateHMS(Number(item.photoDateTimestamp) || 0) }}</span>
</div>
<div v-if="item.submitDateTimestamp" class="time-item time-item2">
<SvgIcon class="svg-time" color="#FFF" size="14" name="submit-time" />
<span>{{ formatToDateHMS(Number(item.submitDateTimestamp) || 0) }}</span>
</div>
</div> </div>
<img v-if="item.historyStates === 2" class="tag-status" src="@/assets/images/task/tag-pass.png" alt=""> <div v-if="item.submitDateTimestamp" class="time-item time-item2">
<img v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png" alt=""> <SvgIcon class="svg-time" color="#FFF" size="14" name="submit-time" />
<div class="check"> <span>{{ formatToDateHMS(Number(item.submitDateTimestamp) || 0) }}</span>
<n-checkbox
v-show="batch && item.historyStates === 1"
v-model:checked="item.checked" @click.prevent
@update:checked="onCheckChange($event, item)"
/>
</div> </div>
<div :class="{ 'percent-red': item.similarityScore === 100 }" class="percent"> </div>
{{ item.similarityScore }}<span class="percent-unit">%</span> <img v-if="item.historyStates === 2" class="tag-status" src="@/assets/images/task/tag-pass.png" alt="">
</div> <img v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png" alt="">
<div class="check">
<n-checkbox
v-show="batch && item.historyStates === 1"
v-model:checked="item.checked" @click.prevent
@update:checked="onCheckChange($event, item)"
/>
</div>
<div :class="{ 'percent-red': item.similarityScore === 100 }" class="percent">
{{ item.similarityScore }}<span class="percent-unit">%</span>
</div>
</div> </div>
</div> </div>
<!-- </n-scrollbar> --> <!-- </n-scrollbar> -->

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { ref } from 'vue'
import bgLoading from '@/assets/images/bg-loading.png'
const props = defineProps({ const props = defineProps({
imgurl: String, imgurl: String,
@ -12,6 +13,7 @@ const props = defineProps({
const imageRef = ref<ComponentElRef | null>() const imageRef = ref<ComponentElRef | null>()
const overTask = ref<any>(null) const overTask = ref<any>(null)
const overTasktwo = ref<any>(null) const overTasktwo = ref<any>(null)
const bgLoadingImg = ref(bgLoading)
function overTaskHandle() { function overTaskHandle() {
const item = props.taskDetailInfo const item = props.taskDetailInfo
@ -65,17 +67,20 @@ function previewHandler(event: MouseEvent) {
isFullScreen isFullScreen
? imgbigshow ? imgbigshow
? { ? {
'position': 'relative', position: 'relative',
'flex': 2, flex: 2,
'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, // 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`,
background: `url(${taskDetailInfo?.ocrPicture?.imgurl}), url(${bgLoadingImg})`,
} }
: { : {
'height': '92vh', height: '92vh',
'flex': 2, flex: 2,
'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, // 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`,
background: `url(${taskDetailInfo?.ocrPicture?.imgurl}), url(${bgLoadingImg})`,
} }
: { : {
'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, // 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`,
background: `url(${taskDetailInfo?.ocrPicture?.imgurl}), url(${bgLoadingImg})`,
} }
" "
@mouseover="overTaskHandle" @mouseover="overTaskHandle"
@ -103,11 +108,16 @@ function previewHandler(event: MouseEvent) {
/> />
</div> </div>
<div class="check"> <div class="check">
<n-checkbox <!-- <n-checkbox
v-show="batch && taskDetailInfo?.userapprove?.statshis === 1" v-show="batch && taskDetailInfo?.userapprove?.statshis === 1"
v-model:checked="taskDetailInfo?.checked" :checked="taskDetailInfo?.checked"
@click.stop @click.stop
@update:checked="onCheckChange($event, taskDetailInfo)" @update:checked="onCheckChange($event, taskDetailInfo)"
/> -->
<n-checkbox
v-show="batch && taskDetailInfo?.userapprove?.statshis === 1"
:checked="taskDetailInfo?.checked"
@click.stop
/> />
</div> </div>

@ -1,16 +1,4 @@
<script lang="ts" setup> <script lang="ts" setup>
import { audit, dubiousfileyd } from '@/api/task/task'
import {
getPictureSimilarityList,
getTaskDetailInfo,
} from '@/api/work/work'
import NotPassed from '@/components/Approval/NotPassed.vue'
import { TASK_STATUS_OBJ } from '@/enums/index'
import { useWorkOrder } from '@/store/modules/workOrder'
import { isEmpty } from '@/utils'
import { formatToDateHMS } from '@/utils/dateUtil'
import { hideDownload } from '@/utils/image'
import emitter from '@/utils/mitt'
import { useInfiniteScroll } from '@vueuse/core' import { useInfiniteScroll } from '@vueuse/core'
import { format } from 'date-fns' import { format } from 'date-fns'
import imagesloaded from 'imagesloaded' import imagesloaded from 'imagesloaded'
@ -28,7 +16,20 @@ import {
} from 'vue' } from 'vue'
import PictureInfo from '../components/PictureInfo.vue' import PictureInfo from '../components/PictureInfo.vue'
import ConfrimModal from '../modal/ConfrimModal.vue' import ConfrimModal from '../modal/ConfrimModal.vue'
import { audit, dubiousfileyd } from '@/api/task/task'
import {
getPictureSimilarityList,
getTaskDetailInfo,
} from '@/api/work/work'
import NotPassed from '@/components/Approval/NotPassed.vue'
import { TASK_STATUS_OBJ } from '@/enums/index'
import { useWorkOrder } from '@/store/modules/workOrder'
import { isEmpty } from '@/utils'
import { formatToDateHMS } from '@/utils/dateUtil'
import { hideDownload } from '@/utils/image'
import emitter from '@/utils/mitt'
import type { ApprovalParam, SimilarityPictureSortParam } from '/#/api' import type { ApprovalParam, SimilarityPictureSortParam } from '/#/api'
import bgLoading from '@/assets/images/bg-loading.png'
const batch = ref(false) // const batch = ref(false) //
const selectItems = ref<any[]>([]) const selectItems = ref<any[]>([])
@ -36,6 +37,7 @@ const message = useMessage()
const dialog = useDialog() const dialog = useDialog()
const totalCount = ref(0) const totalCount = ref(0)
let _imagesload: any let _imagesload: any
const bgLoadingImg = ref(bgLoading)
function setBatch(value: boolean) { function setBatch(value: boolean) {
if (value && batch.value) if (value && batch.value)
@ -798,7 +800,7 @@ defineExpose({
> >
<div <div
class="img-wrapper" class="img-wrapper"
:style="{ 'background-image': `url(${item.imgurl})` }" :style="{ background: `url(${item?.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgurl}), url(${bgLoadingImg})` }"
/> />
<div class="time-wrapper"> <div class="time-wrapper">
<div class="time"> <div class="time">

Loading…
Cancel
Save