This commit is contained in:
zhuoda
2024-01-08 19:52:39 +08:00
parent 8dc663d885
commit 192e959d14
1126 changed files with 13783 additions and 68273 deletions

View File

@@ -22,14 +22,13 @@
</template>
<script setup>
import { PROVINCE_CITY_DISTRICT } from "./province-city-district";
import { PROVINCE_CITY } from "./province-city";
import { ref, toRaw, watch } from "vue";
import { PROVINCE_CITY_DISTRICT } from './province-city-district';
import { PROVINCE_CITY } from './province-city';
import { ref, toRaw, watch } from 'vue';
// ============ 组件属性 ============
const TYPE_PROVINCE_CITY_DISTRICT = "province_city_district";
const TYPE_PROVINCE_CITY = "province_city";
const TYPE_PROVINCE_CITY_DISTRICT = 'province_city_district';
const props = defineProps({
type: String,
@@ -55,22 +54,21 @@
const emit = defineEmits(['update:value', 'change']);
// ============ 组件业务 ============
const areaOptionData =
props.type === TYPE_PROVINCE_CITY_DISTRICT ? PROVINCE_CITY_DISTRICT : PROVINCE_CITY;
const areaOptionData = props.type === TYPE_PROVINCE_CITY_DISTRICT ? PROVINCE_CITY_DISTRICT : PROVINCE_CITY;
// 绑定地区数据
const areaValue = ref([]);
// 监听value变化
watch(
() => props.value,
(newValue) => {
if (newValue) {
let array = [];
for (let index = 0; index < 3; index++) {
if (newValue[index]) {
array.push(newValue[index].value);
}
() => props.value,
(newValue) => {
if (newValue) {
let array = [];
for (let index = 0; index < 3; index++) {
if (newValue[index]) {
array.push(newValue[index].value);
}
}
areaValue.value = array;
} else {
areaValue.value = [];
@@ -78,14 +76,12 @@
}
);
function handleChange(value, selectedOptions){
emit("update:value", toRaw(selectedOptions));
emit("change", value, toRaw(selectedOptions));
function handleChange(value, selectedOptions) {
emit('update:value', toRaw(selectedOptions));
emit('change', value, toRaw(selectedOptions));
}
const filter = (inputValue, path) => {
return path.some(
(option) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1
);
return path.some((option) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
};
</script>

View File

@@ -73,7 +73,7 @@
console.log('boolean enum select', value);
let booleanResult = null;
if (!_.isUndefined(value)) {
booleanResult = value === 1 ? true : false;
booleanResult = value === 1;
}
emit('update:value', booleanResult);
emit('change', booleanResult);

View File

@@ -9,7 +9,7 @@
-->
<template>
<div>
<a-popover v-model:visible="visible" placement="bottomLeft" trigger="click">
<a-popover v-model:open="visible" placement="bottomLeft" trigger="click">
<template #title>
<a-form-item>
<a-radio-group @change="updateSelectIconArray" v-model:value="iconStyle" style="margin: 8px">

View File

@@ -24,7 +24,7 @@
<script setup>
import { shallowRef, onBeforeUnmount, watch, ref } from 'vue';
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
import { fileApi } from '/@/api/support/file/file-api';
import { fileApi } from '/src/api/support/file-api';
import '@wangeditor/editor/dist/css/style.css';
import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
import { smartSentry } from '/@/lib/smart-sentry';

View File

@@ -0,0 +1,97 @@
<!--
* 数据变更记录以table形式显示
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-12 21:01:52
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<a-table size="small" :dataSource="tableData" :columns="columns" rowKey="dataTracerId" :pagination="false" bordered>
<template #bodyCell="{ record, index, column }">
<template v-if="column.dataIndex === 'dataTracerId'">
<div>{{ index + 1 }}</div>
</template>
<template v-if="column.dataIndex === 'userName'">
<div>{{ record.userName }} ({{ $smartEnumPlugin.getDescByValue('USER_TYPE_ENUM', record.userType) }})</div>
</template>
<template v-if="column.dataIndex === 'userAgent'">
<div>{{ record.browser }} / {{ record.os }} / {{ record.device }}</div>
</template>
<template v-if="column.dataIndex === 'content'">
<div class="operate-content" v-html="record.content"></div>
</template>
<template v-else-if="column.dataIndex === 'action'">
<a-button v-if="record.diffOld || record.diffNew" @click="showDetail(record)" type="link">详情 </a-button>
</template>
</template>
</a-table>
</template>
<script setup>
import { reactive } from 'vue';
const props = defineProps({
tableData: {
type: Array,
},
});
const emit = defineEmits(['showDetail']);
function showDetail(record) {
emit('showDetail', record);
}
const columns = reactive([
{
title: '序号',
dataIndex: 'dataTracerId',
width: 50,
},
{
title: '操作时间',
dataIndex: 'createTime',
width: 150,
},
{
title: '操作人',
dataIndex: 'userName',
width: 100,
ellipsis: true,
},
{
title: 'IP',
dataIndex: 'ip',
ellipsis: true,
width: 100,
},
{
title: 'IP地区',
dataIndex: 'ipRegion',
ellipsis: true,
width: 100,
},
{
title: '客户端',
dataIndex: 'userAgent',
ellipsis: true,
width: 150,
},
{
title: '操作内容',
dataIndex: 'content',
},
{
title: '操作',
dataIndex: 'action',
fixed: 'right',
width: 80,
},
]);
</script>
<style scoped lang="less">
.operate-content {
font-size: 14px;
display: inline;
}
</style>

View File

@@ -0,0 +1,50 @@
<!--
* 数据变更记录 timeline 形式显示
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-12 21:01:52
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<a-timeline>
<a-timeline-item v-for="record in tableData" :key="record.dataTracerId">
<div class="trace-div">
<div>
<!-- <div class="operate-content" >{{ record.content }}</div> -->
<div class="operate-content" v-html="record.content"></div>
<a href="javascript:void(0)" v-if="record.diffOld || record.diffNew" @click="showDetail(record)">查看修改</a>
</div>
<div class="ip-font">
{{ record.createTime }} | {{ record.userName }} | {{ record.ipRegion }} | {{ record.ip }} | {{ record.browser }} | {{ record.os }}
</div>
</div>
</a-timeline-item>
</a-timeline>
</template>
<script setup>
const props = defineProps({
tableData: {
type: Array,
},
});
const emit = defineEmits(['showDetail']);
function showDetail(record) {
emit('showDetail', record);
}
</script>
<style scoped lang="less">
.operate-content {
font-size: 14px;
display: inline;
}
.ip-font {
margin-top: 5px;
font-size: 12px;
color: #999;
display: block;
}
</style>

View File

@@ -35,42 +35,26 @@
</a-form>
<a-card size="small" :bordered="false">
<a-table size="small" :dataSource="tableData" :columns="columns" rowKey="dataTracerId" :pagination="false" bordered>
<template #bodyCell="{ record, index, column }">
<template v-if="column.dataIndex === 'dataTracerId'">
<div>{{ index + 1 }}</div>
</template>
<template v-if="column.dataIndex === 'userName'">
<div>{{record.userName}} ({{ $smartEnumPlugin.getDescByValue('USER_TYPE_ENUM', record.userType) }})</div>
</template>
<template v-if="column.dataIndex === 'userAgent'">
<div>{{ record.browser }} / {{ record.os }} / {{ record.device }}</div>
</template>
<template v-if="column.dataIndex === 'content'">
<div class="operate-content" v-html="record.content"></div>
</template>
<template v-else-if="column.dataIndex === 'action'">
<a-button v-if="record.diffOld || record.diffNew" @click="showDetail(record)" type="link">详情 </a-button>
</template>
</template>
</a-table>
<!---以表格形式 显示-->
<!-- <DataTracerTable :tableData="tableData" @showDetail="showDetail" /> -->
<div class="smart-query-table-page">
<a-pagination
showSizeChanger
showQuickJumper
show-less-items
:pageSizeOptions="PAGE_SIZE_OPTIONS"
:defaultPageSize="queryForm.pageSize"
v-model:current="queryForm.pageNum"
v-model:pageSize="queryForm.pageSize"
:total="total"
@change="onSearch"
@showSizeChange="onSearch"
:show-total="(total) => `${total}`"
/>
</div>
<a-modal v-model:visible="visibleDiff" width="90%" title="数据比对" :footer="null">
<!--- timeline 时间轴形式 显示-->
<DataTracerTimeline :tableData="tableData" @showDetail="showDetail" />
<a-pagination
showSizeChanger
showQuickJumper
show-less-items
:pageSizeOptions="PAGE_SIZE_OPTIONS"
:defaultPageSize="queryForm.pageSize"
v-model:current="queryForm.pageNum"
v-model:pageSize="queryForm.pageSize"
:total="total"
@change="ajaxQuery"
@showSizeChange="ajaxQuery"
:show-total="(total) => `${total}`"
/>
<a-modal v-model:open="visibleDiff" width="90%" title="数据比对" :footer="null">
<div v-html="prettyHtml"></div>
</a-modal>
</a-card>
@@ -80,10 +64,11 @@
import * as Diff2Html from 'diff2html';
import 'diff2html/bundles/css/diff2html.min.css';
import uaparser from 'ua-parser-js';
import { nextTick, reactive, ref, watch } from 'vue';
import { dataTracerApi } from '/@/api/support/data-tracer/data-tracer-api';
import { nextTick, reactive, ref, watch } from 'vue';
import { dataTracerApi } from '/src/api/support/data-tracer-api';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
import { smartSentry } from '/@/lib/smart-sentry';
import DataTracerTimeline from './data-tracer-timeline.vue';
let props = defineProps({
// 数据id
@@ -96,47 +81,6 @@
},
});
const columns = reactive([
{
title: '序号',
dataIndex: 'dataTracerId',
width: 50,
},
{
title: '操作时间',
dataIndex: 'createTime',
width: 150,
},
{
title: '操作人',
dataIndex: 'userName',
width: 100,
ellipsis: true,
},
{
title: 'IP',
dataIndex: 'ip',
ellipsis: true,
width: 100,
},
{
title: '客户端',
dataIndex: 'userAgent',
ellipsis: true,
width: 150,
},
{
title: '操作内容',
dataIndex: 'content',
},
{
title: '操作',
dataIndex: 'action',
fixed: 'right',
width: 80,
},
]);
// --------------- 查询表单、查询方法 ---------------
const queryFormState = {
@@ -155,7 +99,12 @@
onSearch();
}
async function onSearch() {
function onSearch() {
queryForm.pageNum = 1;
ajaxQuery();
}
async function ajaxQuery() {
try {
tableLoading.value = true;
let responseModel = await dataTracerApi.queryList(Object.assign({}, queryForm, { dataId: props.dataId, type: props.type }));
@@ -163,6 +112,7 @@
if (!e.userAgent) {
continue;
}
// e.content = e.content.replaceAll('<br/>','');
let ua = uaparser(e.userAgent);
e.browser = ua.browser.name;
e.os = ua.os.name;
@@ -190,17 +140,14 @@
{ immediate: true }
);
// --------------- diff 特效 ---------------
// diff
const visibleDiff = ref(false);
let prettyHtml = ref('');
function showDetail(record) {
visibleDiff.value = true;
let diffOld = record.diffOld.replaceAll('<br/>','\r\n');
let diffNew = record.diffNew.replaceAll('<br/>','\r\n');
console.log(diffOld)
console.log(diffNew)
let diffOld = record.diffOld.replaceAll('<br/>', '\r\n');
let diffNew = record.diffNew.replaceAll('<br/>', '\r\n');
const args = ['', diffOld, diffNew, '变更前', '变更后'];
let diffPatch = Diff.createPatch(...args);
@@ -218,12 +165,12 @@
let left = diffDiv[0],
right = diffDiv[1];
left.addEventListener('scroll', function (e) {
if (left.scrollLeft != right.scrollLeft) {
if (left.scrollLeft !== right.scrollLeft) {
right.scrollLeft = left.scrollLeft;
}
});
right.addEventListener('scroll', function (e) {
if (left.scrollLeft != right.scrollLeft) {
if (left.scrollLeft !== right.scrollLeft) {
left.scrollLeft = right.scrollLeft;
}
});
@@ -231,9 +178,3 @@
});
}
</script>
<style scoped lang="less">
.operate-content {
line-height: 20px;
margin: 5px 0px;
}
</style>

View File

@@ -28,7 +28,7 @@
<script setup>
import { computed, onMounted, ref, watch } from 'vue';
import { dictApi } from '/@/api/support/dict/dict-api';
import { dictApi } from '/src/api/support/dict-api';
const props = defineProps({
value: [Array, String],

View File

@@ -29,7 +29,7 @@
<script setup>
import { computed, onMounted, ref, watch } from 'vue';
import { dictApi } from '/@/api/support/dict/dict-api';
import { dictApi } from '/src/api/support/dict-api';
const props = defineProps({
keyCode: String,

View File

@@ -24,8 +24,8 @@
<script setup>
import { ref } from 'vue';
import { download } from '/@/lib/axios';
import { fileApi } from '/@/api/support/file/file-api';
import { getDownload } from '/@/lib/axios';
import { fileApi } from '/src/api/support/file-api';
import { smartSentry } from '/@/lib/smart-sentry';
import { SmartLoading } from '/@/components/framework/smart-loading';
@@ -62,7 +62,7 @@
setVisible(true);
return;
}
download(fileItem.fileName, fileItem.fileUrl);
getDownload(fileItem.fileName, fileItem.fileUrl);
}
// 判断图片类型

View File

@@ -9,11 +9,11 @@
*
-->
<template>
<div >
<template v-if="type == 'text'">
<div>
<template v-if="type === 'text'">
<a v-for="(item, index) in fileList" :key="index" @click="preview(item, index)">
{{ item.fileName }}
<span v-if="index != fileList.length - 1" v-html="separator"></span>
<span v-if="index !== fileList.length - 1" v-html="separator"></span>
</a>
</template>
<a-space>
@@ -22,7 +22,7 @@
v-for="(item, index) in fileList"
:key="index"
:src="item.fileUrl"
:style="{ display: type == 'text' ? 'none' : '' }"
:style="{ display: type === 'text' ? 'none' : '' }"
:width="width"
/>
</a-image-preview-group>
@@ -31,7 +31,7 @@
</template>
<script setup>
import { ref } from 'vue';
import { download } from '/@/lib/axios';
import { getDownload } from '/@/lib/axios';
let props = defineProps({
fileList: {
@@ -64,7 +64,7 @@
previewCurrent.value = index;
visible.value = true;
} else {
download(file.fileName, file.fileUrl);
getDownload(file.fileName, file.fileUrl);
}
}

View File

@@ -22,13 +22,13 @@
@remove="handleRemove"
>
<div v-if="fileList.length < props.maxUploadSize">
<template v-if="listType == 'picture-card'">
<template v-if="listType === 'picture-card'">
<PlusOutlined />
<div class="ant-upload-text">
{{ buttonText }}
</div>
</template>
<template v-if="listType == 'text'">
<template v-if="listType === 'text'">
<a-button>
<upload-outlined />
{{ buttonText }}
@@ -36,7 +36,7 @@
</template>
</div>
</a-upload>
<a-modal :footer="null" :visible="previewVisible" @cancel="handleCancel">
<a-modal :footer="null" :open="previewVisible" @cancel="handleCancel">
<img :src="previewUrl" alt="example" style="width: 100%" />
</a-modal>
</div>
@@ -44,11 +44,11 @@
<script setup>
import { computed, ref, watch } from 'vue';
import { message } from 'ant-design-vue';
import { fileApi } from '/@/api/support/file/file-api';
import { fileApi } from '/src/api/support/file-api';
import { useUserStore } from '/@/store/modules/system/user';
import { SmartLoading } from '/@/components/framework/smart-loading';
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
import { download } from '/@/lib/axios';
import { getDownload } from '/@/lib/axios';
import { smartSentry } from '/@/lib/smart-sentry';
const props = defineProps({
value: String,
@@ -149,9 +149,9 @@
function handleChange(info) {
let fileStatus = info.file.status;
let file = info.file;
if (fileStatus == 'removed') {
let index = fileList.value.findIndex((e) => e.fileId == file.fileId);
if (index != -1) {
if (fileStatus === 'removed') {
let index = fileList.value.findIndex((e) => e.fileId === file.fileId);
if (index !== -1) {
fileList.value.splice(index, 1);
emit('change', fileList.value);
}
@@ -179,7 +179,7 @@
previewUrl.value = file.url || file.preview;
previewVisible.value = true;
} else {
download(file.fileName, file.fileUrl);
getDownload(file.fileName, file.fileUrl);
}
};

View File

@@ -37,7 +37,7 @@
<script setup>
import _ from 'lodash';
import { tableColumnApi } from '/@/api/support/table/table-column-api';
import { tableColumnApi } from '/src/api/support/table-column-api';
import { onMounted, reactive, ref, watch } from 'vue';
import SmartTableColumnModal from './smart-table-column-modal.vue';
import { message } from 'ant-design-vue';

View File

@@ -9,7 +9,7 @@
*
-->
<template>
<a-modal :width="700" :visible="visible" title="设置列" :destroyOnClose="true" :closable="false">
<a-modal :width="700" :open="visible" title="设置列" :destroyOnClose="true" :closable="false">
<a-alert type="info" show-icon class="smart-margin-bottom10">
<template #icon><smile-outlined /></template>
<template #message> 可以通过拖拽行直接修改顺序哦 <pushpin-outlined />为固定列不可拖拽 </template>
@@ -54,8 +54,8 @@
</template>
<script setup>
import { SmartLoading } from '/@/components/framework/smart-loading';
import { tableColumnApi } from '/@/api/support/table/table-column-api';
import { ref, reactive, nextTick, computed } from 'vue';
import { tableColumnApi } from '/src/api/support/table-column-api';
import { nextTick, ref } from 'vue';
import _ from 'lodash';
import Sortable from 'sortablejs';
import { message, Modal } from 'ant-design-vue';
@@ -107,7 +107,6 @@
for (const item of tableData.value) {
if (item.showFlag) {
selectedRowKeyList.value.push(item.columnKey);
continue;
}
}
@@ -148,7 +147,7 @@
chosenClass: 'smart-ghost-class', //设置选中样式类名
handle: '.handle',
onEnd({ newIndex, oldIndex }) {
if (newIndex == oldIndex) {
if (newIndex === oldIndex) {
return;
}
moveTableData(oldIndex, newIndex);
@@ -240,7 +239,7 @@
if (item.width) {
column.width = item.width;
}
column.showFlag = selectedRowKeyList.value.indexOf(item.columnKey) > -1 ? true : false;
column.showFlag = selectedRowKeyList.value.indexOf(item.columnKey) > -1;
columnList.push(column);
}

View File

@@ -26,7 +26,7 @@
<script setup>
import { onMounted, ref } from 'vue';
import _ from 'lodash';
import { departmentApi } from '/@/api/system/department/department-api';
import { departmentApi } from '/src/api/system/department-api';
const props = defineProps({
// 绑定值

View File

@@ -26,7 +26,7 @@
<script setup>
import { onMounted, ref, watch } from 'vue';
import { employeeApi } from '/@/api/system/employee/employee-api';
import { employeeApi } from '/src/api/system/employee-api';
import { smartSentry } from '/@/lib/smart-sentry';
// =========== 属性定义 和 事件方法暴露 =============

View File

@@ -8,7 +8,7 @@
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<a-modal v-model:visible="visible" :width="900" title="选择人员" @cancel="closeModal" @ok="onSelectEmployee">
<a-modal v-model:open="visible" :width="900" title="选择人员" @cancel="closeModal" @ok="onSelectEmployee">
<a-form class="smart-query-form">
<a-row class="smart-query-form-row">
<a-form-item label="关键字" class="smart-query-form-item">
@@ -24,7 +24,7 @@
</a-select>
</a-form-item>
<a-form-item class="smart-query-form-item smart-margin-left10">
<a-button type="primary" @click="queryEmployee">
<a-button type="primary" @click="onSearch">
<template #icon>
<SearchOutlined />
</template>
@@ -80,13 +80,13 @@
<script setup>
import { message } from 'ant-design-vue';
import { computed, reactive, ref } from 'vue';
import { employeeApi } from '/@/api/system/employee/employee-api';
import { employeeApi } from '/src/api/system/employee-api';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
import DepartmentTreeSelect from '/@/components/system/department-tree-select/index.vue';
import { smartSentry } from '/@/lib/smart-sentry';
// ----------------------- 以下是字段定义 emits props ---------------------
const emits = defineEmits('selectData');
const emits = defineEmits(['selectData']);
defineExpose({
showModal,
});
@@ -97,7 +97,7 @@
async function showModal(selectEmployeeId) {
selectedRowKeyList.value = selectEmployeeId || [];
visible.value = true;
queryEmployee();
onSearch();
}
function closeModal() {
Object.assign(params, defaultParams);
@@ -124,6 +124,12 @@
Object.assign(params, defaultParams);
queryEmployee();
}
function onSearch() {
params.pageNum = 1;
queryEmployee();
}
async function queryEmployee() {
tableLoading.value = true;
try {

View File

@@ -25,7 +25,7 @@
<script setup>
import { onMounted, ref } from 'vue';
import _ from 'lodash';
import { menuApi } from '/@/api/system/menu/menu-api';
import { menuApi } from '/src/api/system/menu-api';
import { buildMenuTableTree } from '/@/views/system/menu/menu-data-handler';
import { MENU_TYPE_ENUM } from '/@/constants/system/menu-const';