hcong
2024-09-27 9a11f818f304bc13bbd920313792e9560734922f
合并冲突
已修改4个文件
已添加1个文件
75 ■■■■■ 文件已修改
src/components.d.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/DeepCopy.js 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/config/components/evalution/CompEvalutionRuleUpd.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components.d.ts
@@ -43,7 +43,6 @@
    ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
    ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup']
    ElOption: typeof import('element-plus/es')['ElOption']
    ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
    ElPagination: typeof import('element-plus/es')['ElPagination']
    ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
    ElPopover: typeof import('element-plus/es')['ElPopover']
src/main.js
@@ -5,6 +5,7 @@
import { router } from './router';
import App from './App.vue';
import timeUtil from './utils/time-util';
import DeepCopy from './utils/DeepCopy';
// import 'element-plus/dist/index.css';
import './assets/main.css';
@@ -17,6 +18,7 @@
const app = createApp(App);
app.config.globalProperties.$fm = timeUtil;
app.config.globalProperties.$deepCopy = DeepCopy.deepCopy;
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
src/router/index.js
@@ -80,7 +80,7 @@
  {
    //璁惧鍖归厤
    name: 'fyspDeviceMatch',
    path: '/fysp/config/deviceMatch',
    path: '/fysp/config/fyspDeviceMatch',
    component: () => import('@/views/fysp/config/DeviceMatch.vue')
  },
  {
@@ -94,7 +94,7 @@
    name: 'fyspEvalutationTask',
    path: '/fysp/evaluation/evalutationTask',
    component: () => import('@/views/fysp/evaluation/EvalutationTask.vue'),
    meta: { keepAlive: false }
    meta: { keepAlive: true }
  },
  {
    //璇勪及绠$悊
src/utils/DeepCopy.js
对比新文件
@@ -0,0 +1,65 @@
export default {
    deepCopy(target) {
        const map = new WeakMap()
        function isObject(target) {
            return (typeof target === 'object' && target ) || typeof target === 'function'
        }
        function clone(data) {
            if (!isObject(data)) {
                return data
            }
            if ([Date, RegExp].includes(data.constructor)) {
                return new data.constructor(data)
            }
            if (typeof data === 'function') {
                return new Function('return ' + data.toString())()
            }
            const exist = map.get(data)
            if (exist) {
                return exist
            }
            if (data instanceof Map) {
                const result = new Map()
                map.set(data, result)
                data.forEach((val, key) => {
                    if (isObject(val)) {
                        result.set(key, clone(val))
                    } else {
                        result.set(key, val)
                    }
                })
                return result
            }
            if (data instanceof Set) {
                const result = new Set()
                map.set(data, result)
                data.forEach(val => {
                    if (isObject(val)) {
                        result.add(clone(val))
                    } else {
                        result.add(val)
                    }
                })
                return result
            }
            const keys = Reflect.ownKeys(data)
            const allDesc = Object.getOwnPropertyDescriptors(data)
            const result = Object.create(Object.getPrototypeOf(data), allDesc)
            map.set(data, result)
            keys.forEach(key => {
                const val = data[key]
                if (isObject(val)) {
                    result[key] = clone(val)
                } else {
                    result[key] = val
                }
            })
            return result
        }
        // clone(target)
        return JSON.parse(JSON.stringify(target));
    }
}
src/views/fysp/config/components/evalution/CompEvalutionRuleUpd.vue
@@ -62,7 +62,10 @@
import { enumScene } from '@/enum/scene';
import { ElMessage } from 'element-plus';
import evaluateApi from '@/api/fysp/evaluateApi';
<<<<<<< HEAD
import { useCloned } from '@vueuse/core';
=======
>>>>>>> c06a5b40718062cc8b4b971322d7c394018cc972
export default {
  props: {
    readonly: {