3 Commits 4435fc6c32 ... fd0e525306

Author SHA1 Message Date
  onlyh fd0e525306 adm:feat> 修改设备\系统 别名称别编码 3 years ago
  onlyh 84a53560c1 Merge remote-tracking branch 'origin/master' 3 years ago
  onlyh ab0168e7f3 adm:feat> 修改设备展示规则 3 years ago

+ 4 - 0
.gitattributes

@@ -0,0 +1,4 @@
+*.eot binary
+*.ttf binary
+*.woff binary
+*.woff2 binary

+ 11 - 0
src/components/business/dataForm.vue

@@ -165,6 +165,7 @@ export default class extends Vue {
                 this.deviceHeaders.dictStages.length > 0 && this.deviceHeaders.dictStages.forEach(item => {
                     if (this.currentHeader == item.name) {
                         item.infos && item.infos.forEach(val => {
+                            this.addFormData(val);
                             if (val.dataType == 'ATTACHMENT') {
                                 pic.push(val)
                             } else {
@@ -173,6 +174,9 @@ export default class extends Vue {
                         })
                     }
                 })
+                this.deviceHeaders.basicInfos.length > 0 && this.deviceHeaders.basicInfos.forEach(item => {
+                    this.addFormData(item)
+                })
             }
             this.header = {
                 basicInfos: {
@@ -187,6 +191,13 @@ export default class extends Vue {
         })
     }
 
+    addFormData(headerItem: any) {
+        if (headerItem.render) {
+            const val = headerItem.render(this.currRowContent)
+            this.form[headerItem.path] = val
+        }
+    }
+
     changeItem(val) {
         console.log(val)
         let _key = Object.keys(val)[0] + '';

+ 1 - 1
src/components/public/adm-multi-table.vue

@@ -58,7 +58,7 @@ export default class extends Vue {
     }
 
     get headerInfoMap() {
-        const arr = [...this.headersStage?.basicInfos?.data?? [], ...this.headersStage?.dictStages?.data?? []]
+        const arr = [...this.headersStage?.basicInfos?.data ?? [], ...this.headersStage?.dictStages?.data ?? []]
         const headerInfoMap: any = {};
         arr.forEach((item: any) => {
             headerInfoMap[item.path] = item;

+ 24 - 17
src/views/maintain/device/index.vue

@@ -111,7 +111,7 @@ export default class extends Vue {
 
     optionProps = {
         value: 'code',
-        label: 'name',
+        label: 'aliasName',
         children: 'children'
     }
 
@@ -229,17 +229,7 @@ export default class extends Vue {
                 // 类型下信息点,默认设计阶段
                 this.headerInformation = res[0] // 获取表头
                 // this.tableData = res[1].content // 主体数据
-                this.tableData = res[1].content.map(i => {
-                    i.readonlyFloor = ''
-                    i.readonlySpace = ''
-                    if (i.floor && i.floor.localName) {
-                        i.readonlyFloor = i.floor.localName
-                    }
-                    if (i.objectInfo) {
-                        i.readonlySpace = i.objectInfo.map(j => j.localName).join(',')
-                    }
-                    return i
-                })
+                this.tableData = res[1].content
                 this.paneMsg = res[0].dictStages.map(i => i.name)
                 this.currentHeader = this.paneMsg[this.activeName]
                 this.headerStage()
@@ -251,7 +241,6 @@ export default class extends Vue {
     }
 
     async handleNext() {
-
         if (this.deviceVal[1]) {
             this.next = false
             this.isWidth = true
@@ -261,8 +250,17 @@ export default class extends Vue {
             await dictInfo(param).then(res => {
                 const basicInfos = [{path: 'bimTypeName', aliasName: '构件分类名称', category: "STATIC", editable: true},
                     {path: 'localId', aliasName: '本地编码', category: "STATIC", editable: true},
-                    {path: 'readonlyFloor', editable: false, aliasName: '所属楼层', category: "STATIC"},
-                    {path: 'readonlySpace', editable: false, aliasName: '所在空间', category: "STATIC"}]
+                    {path: 'floor.localName', editable: false, aliasName: '所属楼层', category: "STATIC"},
+                    {
+                        path: 'onSpace',
+                        editable: false,
+                        aliasName: '所在空间',
+                        dataType: 'STRING',
+                        category: "STATIC",
+                        render: (obj: any) => {
+                            return obj?.objectInfo && obj.objectInfo.map((item: any) => item.localName).join(',') || ''
+                        }
+                    }]
                 this.deviceHeaders = {
                     basicInfos,
                     dictStages: res.dictStages
@@ -305,8 +303,17 @@ export default class extends Vue {
                 data: [
                     {path: 'bimTypeName', aliasName: '构件分类名称', category: "STATIC"},
                     {path: 'localId', aliasName: '本地编码', category: "STATIC"},
-                    {path: 'readonlyFloor', editable: false, aliasName: '所属楼层', category: "STATIC"},
-                    {path: 'readonlySpace', editable: false, aliasName: '所在空间', category: "STATIC"}
+                    {path: 'floor.localName', editable: false, aliasName: '所属楼层', category: "STATIC"},
+                    {
+                        path: 'onSpace',
+                        editable: false,
+                        aliasName: '所在空间',
+                        dataType: 'STRING',
+                        category: "STATIC",
+                        render: (obj: any) => {
+                            return obj?.objectInfo && obj.objectInfo.map((item: any) => item.localName).join(',') || ''
+                        }
+                    }
                 ],
             },
             dictStages: {

+ 1 - 1
src/views/maintain/system/index.vue

@@ -78,7 +78,7 @@ import { allSystem, BeatchQueryParam } from "@/api/equipComponent";
 export default class extends Vue {
     optionProps = {
         value: 'code',
-        label: 'name',
+        label: 'aliasName',
         children: 'children'
     }
     // 设置高度

+ 40 - 3
vue.config.js

@@ -4,12 +4,35 @@ const devServerPort = 28888;
 const stageServerPort = 28889;
 module.exports = {
     // TODO: 更改 publicPath 打包静态文件目录的配置
-    publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
+    publicPath: process.env.NODE_ENV === "production" ? "/" : "/wanda-adm/",
     // TODO:打包名称
     outputDir: "wanda-adm",
+
+    configureWebpack: {
+        module: {
+            rules: [{
+                test: /\.(ttf|otf|eot|woff|woff2)$/,
+                use: {
+                    loader: "file-loader",
+                    options: {
+                        name: "fonts/[name].[ext]",
+                    },
+                },
+            },
+                {
+                    test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
+                    loader: 'url-loader',
+                    options: {
+                        limit: 10000,
+                        name: ('fonts/[name].[ext]')
+                    }
+                }]
+        }
+    },
     //TODO: eslint 是否在保存时检查
+    // assetsDir:'/',
     lintOnSave: process.env.NODE_ENV === "development",
-    productionSourceMap: false,
+    productionSourceMap: true,
     devServer: {
         port: devServerPort,
         open: true,
@@ -20,7 +43,7 @@ module.exports = {
         progress: false,
         proxy: {
             [process.env.VUE_APP_BASE_API]: {
-                target: `http://127.0.0.1:${stageServerPort}/mock-api/v1`,
+                target: `http://127.0.0.1:${ stageServerPort }/mock-api/v1`,
                 changeOrigin: true, // needed for virtual hosted sites
                 ws: true, // proxy websockets
                 pathRewrite: {
@@ -79,6 +102,7 @@ module.exports = {
     pluginOptions: {
         "style-resources-loader": {
             preProcessor: "scss",
+            // sourceMap: true,
             patterns: [
                 path.resolve(__dirname, "src/styles/_variables.scss"),
                 path.resolve(__dirname, "src/styles/_mixins.scss")
@@ -87,6 +111,19 @@ module.exports = {
     },
     // 高级配置
     chainWebpack(config) {
+        config.module
+            .rule("fonts")
+            .test(/\.(ttf|otf|eot|woff|woff2)$/)
+            .use("file-loader")
+            .loader("file-loader")
+            .tap(options => {
+                options = {
+                    // limit: 10000,
+                    name: 'fonts/[name].[ext]',
+                }
+                return options
+            })
+            .end()
         //在html网页包插件的选项列表中提供应用程序的标题,以便
         //可以在中访问索引.html插入正确的标题。
         // https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-plugin