fast(型号):优化代码结构并移除系统配置脚本、解决型号列表选择型号报错问题,打包屏蔽console和debugger
- 移除 public/index.html 中的系统配置脚本引用 - 删除 public/systenConfig.js 文件 - 优化多个组件中的代码结构,移除未使用的变量和注释 - 解决型号列表选择系列报错问题和不显示问题 - 在 vue.config.js 中添加生产环境下的屏蔽console和debugger
This commit is contained in:
parent
fccb5033a7
commit
07948ec07c
|
@ -225,7 +225,6 @@
|
|||
</div>
|
||||
</body>
|
||||
<!-- 全局系统配置(区分系统) -->
|
||||
<script src="./systenConfig.js"></script>
|
||||
<% if (process.env.VUE_APP_ENV === 'drprod' ) { %>
|
||||
<script>
|
||||
// 获取loader-wrapper元素
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
window._SYSTEMCONFIG = {}
|
||||
window._SYSTEMCONFIG['logoURL'] = '@/assets/logo/drgy/logo.png'
|
||||
window._SYSTEMCONFIG['systemName'] = '数字用电管理系统'
|
|
@ -85,7 +85,7 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.avatar)
|
||||
// console.log(this.avatar)
|
||||
},
|
||||
methods: {
|
||||
getIotFileUrl,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<div :class="[classObj,themeClass1]" class="app-wrapper" :style="{'--current-color': theme}">
|
||||
<div :class="[classObj,themeClass1]" :style="{'--current-color': theme}" class="app-wrapper">
|
||||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
|
||||
<sidebar class="sidebar-container" />
|
||||
<div :class="{hasTagsView:needTagsView}" class="main-container">
|
||||
<div :class="{'fixed-header':fixedHeader}" id="navbar-top" :style="navbarShow() ? 'display: none;' : ''">
|
||||
<div id="navbar-top" :class="{'fixed-header':fixedHeader}" :style="navbarShow() ? 'display: none;' : ''">
|
||||
<navbar />
|
||||
<tags-view v-if="needTagsView" />
|
||||
</div>
|
||||
|
@ -44,12 +44,12 @@ export default {
|
|||
fixedHeader: state => state.settings.fixedHeader
|
||||
}),
|
||||
classObj() {
|
||||
console.log({
|
||||
hideSidebar: !this.sidebar.opened,
|
||||
openSidebar: this.sidebar.opened,
|
||||
withoutAnimation: this.sidebar.withoutAnimation,
|
||||
mobile: this.device === 'mobile'
|
||||
})
|
||||
// console.log({
|
||||
// hideSidebar: !this.sidebar.opened,
|
||||
// openSidebar: this.sidebar.opened,
|
||||
// withoutAnimation: this.sidebar.withoutAnimation,
|
||||
// mobile: this.device === 'mobile'
|
||||
// })
|
||||
return {
|
||||
hideSidebar: !this.sidebar.opened,
|
||||
openSidebar: this.sidebar.opened,
|
||||
|
|
|
@ -119,7 +119,6 @@ const attribute = {
|
|||
commit('SET_GROUP_LIST', data.groupList)
|
||||
commit('SET_FUNCTION_LIST', data.functionList)
|
||||
commit('SET_EVENT_LIST', data.eventList)
|
||||
console.log('res:', state, data)
|
||||
},
|
||||
// 新增 属性
|
||||
AddAttribute({ commit, state }, attr) {
|
||||
|
|
|
@ -973,7 +973,6 @@ export default {
|
|||
},
|
||||
// 点击确定按钮
|
||||
resuleClick() {
|
||||
debugger;
|
||||
switch (this.selectResult.tableType) {
|
||||
case "vendor":
|
||||
this.form.vendorId = this.selectResult.vendorId;
|
||||
|
|
|
@ -171,7 +171,7 @@
|
|||
<el-form-item label="厂商编码:" prop="vendorCode">
|
||||
<el-input
|
||||
v-model="form.vendorCode"
|
||||
:disabled="form.vendorId !== null && form.vendorId !== undefault"
|
||||
:disabled="form.vendorId !== null && form.vendorId !== undefined"
|
||||
placeholder="请输入厂商编码"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
|
@ -6,18 +6,9 @@
|
|||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- icon="el-icon-s-platform"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- @click="handleParams"-->
|
||||
<!-- >物模型</el-button-->
|
||||
<!-- >-->
|
||||
<!-- </el-col>-->
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="functionList" height="300px">
|
||||
<el-table v-loading="loading" :data="attrList" height="300px">
|
||||
<el-table-column align="center" label="序号" type="index" width="75" />
|
||||
<el-table-column align="left" label="参数名称" prop="funName" />
|
||||
<el-table-column align="left" label="标识符" prop="funKey" />
|
||||
|
@ -43,7 +34,6 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="属性" align="left" prop="funObj" /> -->
|
||||
<el-table-column
|
||||
v-if="isOption"
|
||||
align="center"
|
||||
|
@ -80,172 +70,154 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改功能定义对话框 -->
|
||||
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="attributeopen" class="eldialog-wrap" width="550px">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
style="padding: 20px 20px 0px 20px"
|
||||
>
|
||||
<el-form-item label="参数名称:" prop="funName">
|
||||
<el-input v-model="form.funName" placeholder="请输入参数名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标识符:" prop="funKey">
|
||||
<el-input
|
||||
v-model="form.funKey"
|
||||
:disabled="tempType === 'update'"
|
||||
placeholder="请输入标识符"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据类型:" prop="funDataType">
|
||||
<el-select
|
||||
v-model="form.funDataType"
|
||||
placeholder="请选择数据类型"
|
||||
@change="funDataTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(dice, value) in funDataTypeOption"
|
||||
:key="value"
|
||||
:label="dice"
|
||||
:value="value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="form.funDataType === 'FLOAT'"
|
||||
label="保留小数位:"
|
||||
prop="funValAcc"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.funValAcc"
|
||||
onkeyup="value=value.replace(/[^\d]/g,'')"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="传输类型:" prop="funRwType">
|
||||
<el-select v-model="form.funRwType" placeholder="请选择传输类型">
|
||||
<el-option
|
||||
v-for="(dice, value) in funRwTypeOption"
|
||||
:key="value"
|
||||
:label="dice"
|
||||
:value="value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="计量单位:" prop="unitName">
|
||||
<el-input v-model="form.unitName" placeholder="请输入计量单位" />
|
||||
</el-form-item>
|
||||
|
||||
<div class="item-title-wrap">数据校验</div>
|
||||
<div class="custom-wrap">
|
||||
<el-button
|
||||
v-if="form.funValidType === 'ENUM'"
|
||||
size="mini"
|
||||
style="position: absolute; top: 460px; left: 40px"
|
||||
@click="addJsonObj"
|
||||
>添加数值</el-button
|
||||
>
|
||||
<el-form-item
|
||||
:style="form.funValidType === 'ENUM' ? 'height: 80px;' : ''"
|
||||
label="校验方式:"
|
||||
prop="funValidType"
|
||||
>
|
||||
<el-select
|
||||
v-model="form.funValidType"
|
||||
placeholder="请选择校验方式"
|
||||
@change="funValidTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(dice, value) in funValidTypeOption"
|
||||
v-show="
|
||||
!(
|
||||
(form.funDataType === 'TEXT' && value === 'RANGE') ||
|
||||
(form.funDataType !== 'TEXT' && value === 'LENGTH') ||
|
||||
(form.funDataType === 'BOOL' && value === 'RANGE') ||
|
||||
(form.funDataType === 'BOOL' && value === 'LENGTH')
|
||||
)
|
||||
"
|
||||
:key="value"
|
||||
:label="dice"
|
||||
:value="value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<div v-if="form.funValidType === 'ENUM'" class="enumTypeDiv">
|
||||
<div class="enum-item">
|
||||
<json-editor
|
||||
ref="jsonEditors"
|
||||
:jsonString="form.funObj"
|
||||
@event="jsonEvent"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-row
|
||||
v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"
|
||||
:gutter="10"
|
||||
class="max-min-row"
|
||||
>
|
||||
<el-col :span="12">
|
||||
<el-form-item label prop="funValMin">
|
||||
<el-input v-model="form.funValMin" placeholder="最小值" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-input disabled placeholder="最小值" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row
|
||||
v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"
|
||||
:gutter="10"
|
||||
class="max-min-row"
|
||||
>
|
||||
<el-col :span="12">
|
||||
<el-form-item label prop="funValMax">
|
||||
<el-input v-model="form.funValMax" placeholder="最大值" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-input disabled placeholder="最大值" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div class="form-button-div">
|
||||
<el-button size="mini" type="primary" @click="submitForm">保存</el-button>
|
||||
<el-button size="mini" @click="cancel">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- <el-dialog-->
|
||||
<!-- :visible.sync="paramsOpen"-->
|
||||
<!-- class="params-eldialog"-->
|
||||
<!-- title="物模型"-->
|
||||
<!-- top="5vh"-->
|
||||
<!-- width="800px"-->
|
||||
<!-- <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="attributeopen" class="eldialog-wrap" width="550px">-->
|
||||
<!-- <el-form-->
|
||||
<!-- ref="form"-->
|
||||
<!-- :model="form"-->
|
||||
<!-- :rules="rules"-->
|
||||
<!-- label-width="100px"-->
|
||||
<!-- style="padding: 20px 20px 0px 20px"-->
|
||||
<!-- >-->
|
||||
<!-- <params-json-wrap-->
|
||||
<!-- v-if="paramsOpen === true"-->
|
||||
<!-- :other="{-->
|
||||
<!-- action: '',-->
|
||||
<!-- prodPK: sourceId,-->
|
||||
<!-- cmdKey: '',-->
|
||||
<!-- }"-->
|
||||
<!-- :paramsList="functionList"-->
|
||||
<!-- ></params-json-wrap>-->
|
||||
<!-- <el-form-item label="参数名称:" prop="funName">-->
|
||||
<!-- <el-input v-model="form.funName" placeholder="请输入参数名称" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="标识符:" prop="funKey">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form.funKey"-->
|
||||
<!-- :disabled="tempType === 'update'"-->
|
||||
<!-- placeholder="请输入标识符"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="数据类型:" prop="funDataType">-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="form.funDataType"-->
|
||||
<!-- placeholder="请选择数据类型"-->
|
||||
<!-- @change="funDataTypeChange"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="(dice, value) in funDataTypeOption"-->
|
||||
<!-- :key="value"-->
|
||||
<!-- :label="dice"-->
|
||||
<!-- :value="value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item-->
|
||||
<!-- v-if="form.funDataType === 'FLOAT'"-->
|
||||
<!-- label="保留小数位:"-->
|
||||
<!-- prop="funValAcc"-->
|
||||
<!-- >-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form.funValAcc"-->
|
||||
<!-- onkeyup="value=value.replace(/[^\d]/g,'')"-->
|
||||
<!-- ></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="传输类型:" prop="funRwType">-->
|
||||
<!-- <el-select v-model="form.funRwType" placeholder="请选择传输类型">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="(dice, value) in funRwTypeOption"-->
|
||||
<!-- :key="value"-->
|
||||
<!-- :label="dice"-->
|
||||
<!-- :value="value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<!-- <el-form-item label="计量单位:" prop="unitName">-->
|
||||
<!-- <el-input v-model="form.unitName" placeholder="请输入计量单位" />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<!-- <div class="item-title-wrap">数据校验</div>-->
|
||||
<!-- <div class="custom-wrap">-->
|
||||
<!-- <el-button-->
|
||||
<!-- v-if="form.funValidType === 'ENUM'"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- style="position: absolute; top: 460px; left: 40px"-->
|
||||
<!-- @click="addJsonObj"-->
|
||||
<!-- >添加数值</el-button-->
|
||||
<!-- >-->
|
||||
<!-- <el-form-item-->
|
||||
<!-- :style="form.funValidType === 'ENUM' ? 'height: 80px;' : ''"-->
|
||||
<!-- label="校验方式:"-->
|
||||
<!-- prop="funValidType"-->
|
||||
<!-- >-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="form.funValidType"-->
|
||||
<!-- placeholder="请选择校验方式"-->
|
||||
<!-- @change="funValidTypeChange"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="(dice, value) in funValidTypeOption"-->
|
||||
<!-- v-show="-->
|
||||
<!-- !(-->
|
||||
<!-- (form.funDataType === 'TEXT' && value === 'RANGE') ||-->
|
||||
<!-- (form.funDataType !== 'TEXT' && value === 'LENGTH') ||-->
|
||||
<!-- (form.funDataType === 'BOOL' && value === 'RANGE') ||-->
|
||||
<!-- (form.funDataType === 'BOOL' && value === 'LENGTH')-->
|
||||
<!-- )-->
|
||||
<!-- "-->
|
||||
<!-- :key="value"-->
|
||||
<!-- :label="dice"-->
|
||||
<!-- :value="value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<!-- <div v-if="form.funValidType === 'ENUM'" class="enumTypeDiv">-->
|
||||
<!-- <div class="enum-item">-->
|
||||
<!-- <json-editor-->
|
||||
<!-- ref="jsonEditors"-->
|
||||
<!-- :jsonString="form.funObj"-->
|
||||
<!-- @event="jsonEvent"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <el-row-->
|
||||
<!-- v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"-->
|
||||
<!-- :gutter="10"-->
|
||||
<!-- class="max-min-row"-->
|
||||
<!-- >-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label prop="funValMin">-->
|
||||
<!-- <el-input v-model="form.funValMin" placeholder="最小值" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-input disabled placeholder="最小值" />-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
<!-- <el-row-->
|
||||
<!-- v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"-->
|
||||
<!-- :gutter="10"-->
|
||||
<!-- class="max-min-row"-->
|
||||
<!-- >-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label prop="funValMax">-->
|
||||
<!-- <el-input v-model="form.funValMax" placeholder="最大值" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-input disabled placeholder="最大值" />-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-form>-->
|
||||
|
||||
<!-- <div class="form-button-div">-->
|
||||
<!-- <el-button size="mini" type="primary" @click="submitForm">保存</el-button>-->
|
||||
<!-- <el-button size="mini" @click="cancel">取消</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
|
||||
import JsonEditor from "./jsonEditor.vue";
|
||||
import ParamsJsonWrap from "./paramsJson";
|
||||
const funDataTypeOption = {
|
||||
INT32: "整数型",
|
||||
FLOAT: "浮点型",
|
||||
|
@ -269,7 +241,6 @@ export default {
|
|||
name: "CustomParams",
|
||||
components: {
|
||||
JsonEditor,
|
||||
ParamsJsonWrap,
|
||||
},
|
||||
props: {
|
||||
sourceId: {
|
||||
|
@ -286,23 +257,16 @@ export default {
|
|||
funDataTypeOption,
|
||||
funRwTypeOption,
|
||||
funValidTypeOption,
|
||||
paramsOpen: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 功能定义表格数据
|
||||
functionList: [],
|
||||
attrList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
attributeopen: false,
|
||||
// attributeopen: false,
|
||||
// 查询参数
|
||||
queryParams: {},
|
||||
// 表单参数
|
||||
|
@ -319,6 +283,15 @@ export default {
|
|||
tempType: "",
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["attributeList"]),
|
||||
},
|
||||
watch: {
|
||||
attributeList(newVal, oldVal) {
|
||||
// 处理数据变化
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
|
@ -346,11 +319,11 @@ export default {
|
|||
/** 查询功能定义列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
this.functionList = []
|
||||
this.attrList = []
|
||||
setTimeout(() => {
|
||||
this.$store.dispatch("GetAttributeList").then((res) => {
|
||||
console.log('666', res)
|
||||
this.functionList = res
|
||||
this.attrList = res
|
||||
this.$forceUpdate()
|
||||
this.loading = false
|
||||
});
|
||||
|
@ -358,81 +331,71 @@ export default {
|
|||
},
|
||||
setList(list) {
|
||||
this.loading = true
|
||||
this.functionList = []
|
||||
this.attrList = []
|
||||
setTimeout(() => {
|
||||
this.functionList = list
|
||||
this.attrList = list
|
||||
this.$forceUpdate()
|
||||
this.loading = false
|
||||
}, 50)
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.attributeopen = false;
|
||||
this.reset();
|
||||
},
|
||||
// // 取消按钮
|
||||
// cancel() {
|
||||
// this.attributeopen = false;
|
||||
// this.reset();
|
||||
// },
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
sourceId: this.sourceId,
|
||||
mainId: undefined,
|
||||
funName: undefined,
|
||||
funKey: undefined,
|
||||
funDataType: undefined,
|
||||
funValAcc: undefined,
|
||||
funRwType: undefined,
|
||||
funValidType: undefined,
|
||||
funValMin: undefined,
|
||||
funValMax: undefined,
|
||||
funObj: {},
|
||||
unitName: "",
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleParams() {
|
||||
this.$emit('handleClick', { type: 'param', idx: 0 })
|
||||
},
|
||||
// reset() {
|
||||
// this.form = {
|
||||
// sourceId: this.sourceId,
|
||||
// mainId: undefined,
|
||||
// funName: undefined,
|
||||
// funKey: undefined,
|
||||
// funDataType: undefined,
|
||||
// funValAcc: undefined,
|
||||
// funRwType: undefined,
|
||||
// funValidType: undefined,
|
||||
// funValMin: undefined,
|
||||
// funValMax: undefined,
|
||||
// funObj: {},
|
||||
// unitName: "",
|
||||
// };
|
||||
// this.resetForm("form");
|
||||
// },
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.$emit('handleClick', { type: 'add', idx: 0 })
|
||||
},
|
||||
handleCope(row) {
|
||||
this.reset();
|
||||
const funId = row.funId
|
||||
this.tempType = "create";
|
||||
this.title = "复制自定义参数";
|
||||
this.form = row;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row, idx, type) {
|
||||
this.$emit('handleClick', { 'type': type, 'idx': idx })
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
// 新增和修改操作
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row, idx) {
|
||||
var that = this
|
||||
this.$confirm(
|
||||
// '是否确认删除功能定义编号为"' + funIds + '"的数据项?',
|
||||
"是否删除该选项",
|
||||
"警告",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
// 执行删除数据
|
||||
that.$store.dispatch('DeleteAttribute', idx)
|
||||
that.$emit('handleClick', { 'type': 'list' })
|
||||
})
|
||||
},
|
||||
// /** 提交按钮 */
|
||||
// submitForm: function () {
|
||||
// this.$refs["form"].validate((valid) => {
|
||||
// if (valid) {
|
||||
// // 新增和修改操作
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// /** 删除按钮操作 */
|
||||
// handleDelete(row, idx) {
|
||||
// var that = this
|
||||
// this.$confirm(
|
||||
// // '是否确认删除功能定义编号为"' + funIds + '"的数据项?',
|
||||
// "是否删除该选项",
|
||||
// "警告",
|
||||
// {
|
||||
// confirmButtonText: "确定",
|
||||
// cancelButtonText: "取消",
|
||||
// type: "warning",
|
||||
// }
|
||||
// )
|
||||
// .then(() => {
|
||||
// // 执行删除数据
|
||||
// that.$store.dispatch('DeleteAttribute', idx)
|
||||
// that.$emit('handleClick', { 'type': 'list' })
|
||||
// })
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -136,6 +136,17 @@ export default {
|
|||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
eventsList() {
|
||||
return this.$store.state.attribute.eventList;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
eventsList(newVal, oldVal) {
|
||||
// 处理数据变化
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
|
|
|
@ -265,7 +265,7 @@ export default {
|
|||
},
|
||||
functionList: {
|
||||
type: Array,
|
||||
default: []
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="functionList" height="300px">
|
||||
<el-table v-loading="loading" :data="functionsList" height="300px">
|
||||
<el-table-column align="center" label="序号" type="index" width="75" />
|
||||
<el-table-column align="left" label="功能名称" prop="name" />
|
||||
<el-table-column align="left" label="标识符" prop="id" />
|
||||
|
@ -42,7 +42,7 @@
|
|||
@click="handleMoveUp(scope.$index)"
|
||||
>上移</el-button>
|
||||
<el-button
|
||||
:disabled="scope.$index === functionList.length - 1"
|
||||
:disabled="scope.$index === functionsList.length - 1"
|
||||
icon="el-icon-arrow-down"
|
||||
size="mini"
|
||||
type="text"
|
||||
|
@ -69,7 +69,7 @@
|
|||
|
||||
<function-form-model
|
||||
ref="functionForm"
|
||||
:functionList="functionList"
|
||||
:functionList="functionsList"
|
||||
:paramIdx="functionFormObj.paramIdx"
|
||||
:row="functionFormObj.functionForm"
|
||||
:tempType="functionFormObj.modelType"
|
||||
|
@ -82,6 +82,7 @@
|
|||
|
||||
<script>
|
||||
import functionFormModel from "@/views/profile/attribute/functionFormModel";
|
||||
import { mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "FunctionView",
|
||||
|
@ -104,7 +105,7 @@ export default {
|
|||
// 遮罩层
|
||||
loading: true,
|
||||
// 功能定义表格数据
|
||||
functionList: [],
|
||||
functionsList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 表单参数
|
||||
|
@ -123,6 +124,15 @@ export default {
|
|||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["functionList"]),
|
||||
},
|
||||
watch: {
|
||||
functionList(newVal, oldVal) {
|
||||
// 处理数据变化
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
|
@ -139,10 +149,10 @@ export default {
|
|||
/** 查询功能定义列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.functionList = [];
|
||||
this.functionsList = [];
|
||||
setTimeout(() => {
|
||||
this.$store.dispatch("GetFunctionList").then(res => {
|
||||
this.functionList = res;
|
||||
this.functionsList = res;
|
||||
this.$forceUpdate();
|
||||
this.loading = false;
|
||||
});
|
||||
|
@ -150,9 +160,9 @@ export default {
|
|||
},
|
||||
setList(list) {
|
||||
this.loading = true;
|
||||
this.functionList = [];
|
||||
this.functionsList = [];
|
||||
setTimeout(() => {
|
||||
this.functionList = list;
|
||||
this.functionsList = list;
|
||||
this.$forceUpdate();
|
||||
this.loading = false;
|
||||
}, 50);
|
||||
|
@ -207,12 +217,12 @@ export default {
|
|||
if (index === 0) return; // 已经是第一个,不能再上移
|
||||
|
||||
// 交换当前项与上一项的位置
|
||||
const temp = this.functionList[index];
|
||||
this.$set(this.functionList, index, this.functionList[index - 1]);
|
||||
this.$set(this.functionList, index - 1, temp);
|
||||
const temp = this.functionsList[index];
|
||||
this.$set(this.functionsList, index, this.functionsList[index - 1]);
|
||||
this.$set(this.functionsList, index - 1, temp);
|
||||
|
||||
// 保存到 store
|
||||
this.$store.dispatch("UpdateFunctionList", this.functionList).then(() => {
|
||||
this.$store.dispatch("UpdateFunctionList", this.functionsList).then(() => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '上移成功!'
|
||||
|
@ -229,15 +239,15 @@ export default {
|
|||
* @param {Number} index 当前功能索引
|
||||
*/
|
||||
handleMoveDown(index) {
|
||||
if (index === this.functionList.length - 1) return; // 已经是最后一个,不能再下移
|
||||
if (index === this.functionsList.length - 1) return; // 已经是最后一个,不能再下移
|
||||
|
||||
// 交换当前项与下一项的位置
|
||||
const temp = this.functionList[index];
|
||||
this.$set(this.functionList, index, this.functionList[index + 1]);
|
||||
this.$set(this.functionList, index + 1, temp);
|
||||
const temp = this.functionsList[index];
|
||||
this.$set(this.functionsList, index, this.functionsList[index + 1]);
|
||||
this.$set(this.functionsList, index + 1, temp);
|
||||
|
||||
// 保存到 store
|
||||
this.$store.dispatch("UpdateFunctionList", this.functionList).then(() => {
|
||||
this.$store.dispatch("UpdateFunctionList", this.functionsList).then(() => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '下移成功!'
|
||||
|
|
|
@ -184,18 +184,6 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 查询分组参数列表
|
||||
getCmdById(row) {
|
||||
// getCmdFun({
|
||||
// cmdId: row.cmdId,
|
||||
// sourceId: this.sourceId
|
||||
// }).then(res => {
|
||||
// this.selectCmdInfo = row;
|
||||
// this.paramsList = res.data;
|
||||
// this.cmdParamTitle = `${row.cmdName}--示例`;
|
||||
// this.paramsOpen = true;
|
||||
// });
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
|
|
|
@ -47,8 +47,6 @@ import attributeView from "./attributeView";
|
|||
import groupView from "./groupView";
|
||||
import FunctionView from "./functionView";
|
||||
import EventView from "./eventView";
|
||||
// this.$store.state.tagsView.visitedViews
|
||||
// this.$store.dispatch("Login", this.loginForm)
|
||||
export default {
|
||||
components: { FunctionView, attributeView, groupView, EventView },
|
||||
props: {
|
||||
|
@ -138,42 +136,6 @@ export default {
|
|||
break;
|
||||
}
|
||||
},
|
||||
functionEvent(data) {
|
||||
switch (data.type) {
|
||||
case "add":
|
||||
// 执行add
|
||||
this.$emit("handleEvent", {
|
||||
type: data.type,
|
||||
title: "新增参数",
|
||||
component: "functionForm",
|
||||
paramIdx: null
|
||||
});
|
||||
break;
|
||||
|
||||
case "update":
|
||||
this.$emit("handleEvent", {
|
||||
type: data.type,
|
||||
title: "修改参数",
|
||||
component: "functionForm",
|
||||
paramIdx: data.idx,
|
||||
row: data.row
|
||||
});
|
||||
break;
|
||||
|
||||
case "list":
|
||||
this.$refs.functionref.getList();
|
||||
break;
|
||||
|
||||
case "param":
|
||||
this.$emit("handleEvent", {
|
||||
type: data.type,
|
||||
title: "物模型",
|
||||
component: "paramsJson",
|
||||
paramIdx: null
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
forceUpdate(component) {
|
||||
if (component === "groupForm") {
|
||||
this.$refs.groupref && this.$refs.groupref.getList();
|
||||
|
@ -185,14 +147,28 @@ export default {
|
|||
},
|
||||
forceUpdateList(component) {
|
||||
let arttributeList = [],
|
||||
groupList = [];
|
||||
groupList = [],
|
||||
functionList = [],
|
||||
eventList = [];
|
||||
|
||||
try {
|
||||
arttributeList = JSON.parse(this.arttributeList);
|
||||
let json = JSON.parse(this.arttributeList);
|
||||
// if (json.properties) {
|
||||
arttributeList = json.properties;
|
||||
groupList = JSON.parse(this.groupList);
|
||||
functionList = json.functions;
|
||||
eventList = json.events;
|
||||
// } else {
|
||||
// arttributeList = json;
|
||||
// groupList = JSON.parse(this.groupList);
|
||||
// functionList = json.functions;
|
||||
// eventList = json.events;
|
||||
// }
|
||||
} catch (error) {
|
||||
(arttributeList = []), (groupList = []);
|
||||
console.log(error);
|
||||
arttributeList = [];
|
||||
groupList = [];
|
||||
functionList = [];
|
||||
eventList = [];
|
||||
}
|
||||
|
||||
if (component === "groupForm") {
|
||||
|
@ -216,27 +192,24 @@ export default {
|
|||
|
||||
try {
|
||||
let json = JSON.parse(this.arttributeList);
|
||||
if (json.properties) {
|
||||
// if (json.properties) {
|
||||
arttributeList = json.properties;
|
||||
groupList = JSON.parse(this.groupList);
|
||||
functionList = json.functions;
|
||||
eventList = json.events;
|
||||
} else {
|
||||
arttributeList = json;
|
||||
groupList = JSON.parse(this.groupList);
|
||||
functionList = json.functions;
|
||||
eventList = json.events;
|
||||
}
|
||||
// } else {
|
||||
// arttributeList = json;
|
||||
// groupList = JSON.parse(this.groupList);
|
||||
// functionList = json.functions;
|
||||
// eventList = json.events;
|
||||
// }
|
||||
} catch (error) {
|
||||
arttributeList = [];
|
||||
groupList = [];
|
||||
functionList = [];
|
||||
eventList = [];
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
console.log(arttributeList, groupList);
|
||||
|
||||
this.$store.dispatch("InitAttributeAndGroup", {
|
||||
attrList: arttributeList,
|
||||
groupList: groupList,
|
||||
|
|
|
@ -134,6 +134,25 @@ module.exports = {
|
|||
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
|
||||
to: './', //到根目录下
|
||||
}
|
||||
if (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'drprod' || process.env.NODE_ENV === 'drgyprod' || process.env.NODE_ENV === 'ccprod') {
|
||||
config.optimization.minimizer('terser').tap(args => {
|
||||
args[0].terserOptions = {
|
||||
compress: {
|
||||
// 注释console.*
|
||||
drop_console: true,
|
||||
// remove debugger
|
||||
drop_debugger: true,
|
||||
// 移除特定的 console 方法
|
||||
pure_funcs: ['console.log', 'console.info', 'console.debug']
|
||||
},
|
||||
format: {
|
||||
comments: false
|
||||
}
|
||||
};
|
||||
args[0].extractComments = false;
|
||||
return args;
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue