diff --git a/package.json b/package.json
index a30537fbd758f9127eee8235cc13b8c862b46bf9..b3743f0b96a93bef6155dbd4647eedd06d34111e 100755
--- a/package.json
+++ b/package.json
@@ -70,6 +70,7 @@
"particles.vue": "^2.42.2",
"qs": "^6.11.2",
"save": "^2.4.0",
+ "v-code-diff": "^1.13.1",
"vue": "^2.7.16",
"vue-codemirror": "^4.0.6",
"vue-cropper": "^0.5.6",
@@ -82,15 +83,14 @@
"vue-loader": "^17.4.0",
"vue-router": "^3.5.4",
"vuedraggable": "^2.23.2",
- "vuex": "^3.0.1",
- "xlsx": "^0.18.5"
+ "vuex": "^3.0.1"
},
"devDependencies": {
"@babel/core": "^7.24.5",
"@babel/eslint-parser": "^7.12.16",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.5",
- "@rsbuild/core": "^1.2.4",
+ "@rsbuild/core": "^1.4.6",
"@rsbuild/plugin-less": "^1.1.0",
"@rsbuild/plugin-vue2": "^1.0.2",
"@vue/cli-plugin-babel": "~5.0.6",
diff --git a/src/resources/api/cmdb/cientity/cientity.js b/src/resources/api/cmdb/cientity/cientity.js
index 7c5789d3afcd4246610e1de8fdd9fd2149bd8723..c73a733f5a40f31d4d558a45e8f1dfd160b79a76 100644
--- a/src/resources/api/cmdb/cientity/cientity.js
+++ b/src/resources/api/cmdb/cientity/cientity.js
@@ -73,9 +73,11 @@ const cientity = {
getCiEntityBaseInfoByIdList(idList) {
return axios.post('/api/rest/cmdb/cientity/baseinfo/list', { idList: idList });
},
+ /*已删除
getCiEntityByIdList(ciId, idList) {
return axios.post('/api/rest/cmdb/cientity/list', { ciId: ciId, idList: idList });
},
+ */
getCiEntityTopoData(params) {
return axios.post('/api/rest/cmdb/topo/cientity', params);
},
diff --git a/src/resources/assets/css/theme.less b/src/resources/assets/css/theme.less
index 5b3fc45e98b037b0d949679020539dba0ddd20f9..a4f2decf7c690170454bd6e6574470347130e612 100644
--- a/src/resources/assets/css/theme.less
+++ b/src/resources/assets/css/theme.less
@@ -4119,6 +4119,71 @@
}
}
}
+
+ // code-diff 对比样式
+ .code-diff-view {
+ border: 1px solid var(--border-color, @border-color-base);
+ background-color: @op-color;
+ .file-header {
+ background-color: @background-color;
+ border-bottom: 1px solid var(--border-color, @border-color-base);
+ .file-info {
+ .info-left,
+ .info-right {
+ color: @text-color;
+ }
+ }
+ }
+ .file-diff-split {
+ .blob-code + .blob-num {
+ border-left: 1px solid var(--border-color, @border-color-base);
+ }
+ }
+ .diff-table {
+ .blob-num-deletion,
+ .blob-code-deletion {
+ background-color: #fdd;
+ }
+ .blob-code-deletion,
+ .blob-code-addition {
+ .hljs-regexp,
+ .hljs-attr,
+ .hljs-attribute,
+ .hljs-literal,
+ .hljs-meta,
+ .hljs-number,
+ .hljs-string,
+ .hljs-operator,
+ .hljs-variable,
+ .hljs-punctuation,
+ .hljs-selector-attr,
+ .hljs-selector-class,
+ .hljs-selector-id {
+ color: #212121 !important; // 新增删除高亮行保持黑色,确保字体可见
+ }
+ }
+ .blob-code {
+ .blob-code-inner {
+ color: @text-color;
+ }
+ }
+ }
+ .hljs-regexp,
+ .hljs-attr,
+ .hljs-attribute,
+ .hljs-literal,
+ .hljs-meta,
+ .hljs-number,
+ .hljs-string,
+ .hljs-operator,
+ .hljs-variable,
+ .hljs-punctuation,
+ .hljs-selector-attr,
+ .hljs-selector-class,
+ .hljs-selector-id {
+ color: @text-color !important;
+ }
+ }
}
.theme-dark {
diff --git a/src/resources/assets/js/util.js b/src/resources/assets/js/util.js
index e81b3b329d5273bb5c643937a298cc0e8f1bf6f2..21b03e3f6f7cdc0e2584b5d5a33c8e3825f5e51b 100644
--- a/src/resources/assets/js/util.js
+++ b/src/resources/assets/js/util.js
@@ -1243,5 +1243,32 @@ const methods = {
}
return result;
},
+ isValidTimeString(timeStr) { //校验时间字符串
+ if(!timeStr || typeof timeStr !== 'string') {
+ return false;
+ }
+ const parts = timeStr.split(':');
+ if (parts.length === 2) {
+ const [h, m] = parts.map(Number);
+ return h >= 0 && h < 24 && m >= 0 && m < 60;
+ } else if (parts.length === 3) {
+ const [h, m, s] = parts.map(Number);
+ return h >= 0 && h < 24 && m >= 0 && m < 60 && s >= 0 && s;
+ }
+ return false;
+ },
+ isValidDateTime(dateStr) { //校验日期时间字符串
+ // 检查是否为Date对象实例
+ if (dateStr instanceof Date) {
+ return !isNaN(dateStr.getTime());
+ }
+ // 检查是否为可解析的日期字符串
+ if (typeof dateStr === 'string') {
+ // 尝试解析为Date对象
+ const date = new Date(dateStr);
+ return !isNaN(date.getTime());
+ }
+ return false;
+ }
};
export default methods;
diff --git a/src/resources/assets/languages/page/en.json b/src/resources/assets/languages/page/en.json
index aa34785c660052a328bab9cae9d57ee8f8515db6..4fa43bc3ff91681456a084895e5d029a6907f7c5 100644
--- a/src/resources/assets/languages/page/en.json
+++ b/src/resources/assets/languages/page/en.json
@@ -1078,5 +1078,6 @@
"autoexecparallel": "Concurrent settings",
"paramkeyword": "Participate in search",
"loglevel": "log level",
- "bluegreen": "Blue green execution"
+ "bluegreen": "Blue green execution",
+ "mailserver": "mail serve"
}
\ No newline at end of file
diff --git a/src/resources/assets/languages/page/zh.json b/src/resources/assets/languages/page/zh.json
index 6a19d149c036c093d5083f92a5cf8b4a1a4ee5b2..7c447c9a2238bdff96d4b01e6de63146a04beed9 100644
--- a/src/resources/assets/languages/page/zh.json
+++ b/src/resources/assets/languages/page/zh.json
@@ -1080,5 +1080,6 @@
"autoexecparallel": "并发设置",
"paramkeyword": "入参搜索",
"loglevel": "日志级别",
- "bluegreen": "蓝绿执行"
+ "bluegreen": "蓝绿执行",
+ "mailserver": "邮件服务"
}
\ No newline at end of file
diff --git a/src/resources/assets/languages/router/en.json b/src/resources/assets/languages/router/en.json
index 22778a4b8228a6d573ee6710c0f950453b350db5..9e4a22acb2030b9e13d5d0acbaae9afa18a54708 100644
--- a/src/resources/assets/languages/router/en.json
+++ b/src/resources/assets/languages/router/en.json
@@ -156,7 +156,7 @@
"tenantconfigmanage": "Configuration information management",
"threaddump": "Thread snapshot",
"sqldump": "SQL Monitoring",
- "servermanage": "Server management",
+ "servermanage": "Server instance status",
"databasefragment": "Database Fragmentation",
"licensemanage": "Licenses",
"batchoperation": "Batch Operation",
@@ -164,7 +164,7 @@
"message": "Messages and Announcements",
"integration": "Data and Integration",
"notify": "Notification and Subscription",
- "job": "Timed job",
+ "agent": "Agent & Runner",
"others": "Basic Services",
"healthcheck": "Health Check",
"license": "License Management",
@@ -309,4 +309,4 @@
"catalogdetail": "Catalog Detail",
"diagramdetail": "Diagram Detail"
}
-}
\ No newline at end of file
+}
diff --git a/src/resources/assets/languages/router/zh.json b/src/resources/assets/languages/router/zh.json
index 0e70111e70dc26e17bacafb9fe3b6ceaab5ea4f3..c3b0f5a2b0a8a21c733465ea58a9e7eb25e95ccc 100644
--- a/src/resources/assets/languages/router/zh.json
+++ b/src/resources/assets/languages/router/zh.json
@@ -156,7 +156,7 @@
"tenantconfigmanage": "系统参数",
"threaddump": "线程快照",
"sqldump": "SQL监控",
- "servermanage": "服务器管理",
+ "servermanage": "服务节点状态",
"databasefragment": "数据库碎片整理",
"licensemanage": "查看许可",
"batchoperation": "批量操作",
@@ -164,7 +164,7 @@
"message": "消息和公告",
"integration": "数据和集成",
"notify": "通知和订阅",
- "job": "定时作业",
+ "agent": "代理和执行器",
"others": "基础服务",
"healthcheck": "健康检查",
"license": "许可管理",
@@ -309,4 +309,4 @@
"catalogdetail": "目录详情",
"diagramdetail": "架构图详情"
}
-}
\ No newline at end of file
+}
diff --git a/src/resources/assets/languages/term/en.json b/src/resources/assets/languages/term/en.json
index 1f4d07ac5207ae2f2932f128f7101001c49ed735..6918715453f3c07448bdb3f60159c1ce8d1196a2 100644
--- a/src/resources/assets/languages/term/en.json
+++ b/src/resources/assets/languages/term/en.json
@@ -246,7 +246,8 @@
"pause": "stop it",
"cientityisnotfound": "Configuration item does not exist",
"testaccount": "test result",
- "repeataccount": "The same protocol and username cannot bind multiple accounts with the same protocol and username to the same asset."
+ "repeataccount": "The same protocol and username cannot bind multiple accounts with the same protocol and username to the same asset.",
+ "datadetail": "Data Details"
},
"process": {
"workordercenter": "Work Center",
@@ -2858,7 +2859,28 @@
"alert": "give an alarm",
"isnormalattr": "As a regular attribute display",
"closesuccess": "Close successfully",
- "istop": "topped"
+ "istop": "topped",
+ "onlysearchparentalert": "Only search for parent alarms",
+ "searchallalert": "Search for all alarms",
+ "closeselectedalert": "Close selected alarms",
+ "openselectedalert": "Open the selected alarm",
+ "deletematchalert": "Delete matching alarm",
+ "allalert": "All Alarms",
+ "alerttopo": "Alarm topology",
+ "alertdetail": "Alarm details",
+ "applychildalert": "Simultaneously apply sub alarms",
+ "transferworker": "Transfer to the handler",
+ "transferteam": "Transfer to processing team",
+ "reportdata": "reported data",
+ "eventaudit": "Event record",
+ "alertnotexists": "Alarm does not exist or has been deleted",
+ "childalert": "Sub alarm",
+ "dealresult": "Processing results",
+ "createalert": "Create an alarm",
+ "defaultstatus": "Defaults on",
+ "joinalert": "Merge into alarms",
+ "uniquekey": "unique",
+ "alertsign": "Alarm features"
},
"runnergroup": {
"ruletips": "The request for login authentication needs to carry a header as a rule expression (note that the header parameter in the expression is all lowercase). If the value of the expression after execution is true, the executor group will take effect, and false and syntax exceptions will not take effect. For example: ${env}==\\ bit \\&&(${test}==\\ 1 \\ | | ${test2}==\\ aaa \\)"
diff --git a/src/resources/assets/languages/term/zh.json b/src/resources/assets/languages/term/zh.json
index 7e901aa7d39119a7e4f8df7e761c831168510fb1..d04b9b894d02c2d0d9eb61b2060a5160539d0868 100644
--- a/src/resources/assets/languages/term/zh.json
+++ b/src/resources/assets/languages/term/zh.json
@@ -247,7 +247,8 @@
"pause": "停止",
"cientityisnotfound": "配置项不存在",
"testaccount": "测试结果",
- "repeataccount": "协议相同且用户名相同,同一资产不可绑定多个协议相同且用户名相同的账号。"
+ "repeataccount": "协议相同且用户名相同,同一资产不可绑定多个协议相同且用户名相同的账号。",
+ "datadetail": "数据明细"
},
"process": {
"workordercenter": "工单中心",
@@ -2858,6 +2859,27 @@
"alert": "告警",
"isnormalattr": "作为普通属性展示",
"closesuccess": "关闭成功",
- "istop": "是否置顶"
+ "istop": "是否置顶",
+ "onlysearchparentalert": "只搜索父告警",
+ "searchallalert": "搜索所有告警",
+ "closeselectedalert": "关闭选中告警",
+ "openselectedalert": "打开选中告警",
+ "deletematchalert": "删除匹配告警",
+ "allalert": "所有告警",
+ "alerttopo": "告警拓扑",
+ "alertdetail": "告警详情",
+ "applychildalert": "同时应用子告警",
+ "transferworker": "转交处理人",
+ "transferteam": "转交处理组",
+ "reportdata": "上报数据",
+ "eventaudit": "事件记录",
+ "alertnotexists": "告警不存在或已被删除",
+ "childalert": "子告警",
+ "dealresult": "处理结果",
+ "createalert": "创建告警",
+ "defaultstatus": "默认状态",
+ "joinalert": "归并到告警",
+ "uniquekey": "唯一键",
+ "alertsign": "告警特征"
}
}
\ No newline at end of file
diff --git a/src/resources/mixins/formMixins.js b/src/resources/mixins/formMixins.js
index c00deb1a0fcdcb01996b2315c82708af08e886e3..d4b039ce26fa9a754d7020c074887cd082262807 100644
--- a/src/resources/mixins/formMixins.js
+++ b/src/resources/mixins/formMixins.js
@@ -120,8 +120,8 @@ export default {
if (Array.isArray(value)) {
let valueList = [];
value.forEach(v => {
- if (v != false && !this.$utils.isEmpty(v)) {
- if (this.isCustomValue && v[this.valueName]) {
+ if (!this.$utils.isEmpty(v)) { // 兼容为0的情况检验不通过的问题
+ if (this.isCustomValue && !this.$utils.isEmpty(v[this.valueName])) {
// 数组对象类型
valueList.push(v?.[this.valueName]);
} else {
diff --git a/src/resources/plugins/TsSheet/form-item.vue b/src/resources/plugins/TsSheet/form-item.vue
index 57439642ff452751a2ae4fe492387954887eba8a..3ddef96fa837e0b216920ff5ae8f7a207b4301c3 100644
--- a/src/resources/plugins/TsSheet/form-item.vue
+++ b/src/resources/plugins/TsSheet/form-item.vue
@@ -2,7 +2,7 @@
+
+
{{ $t('page.autoexecparallel') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ $t('term.deploy.actuatorgroup') }}
@@ -92,6 +137,9 @@ export default {
TsForm: () => import('@/resources/plugins/TsForm/TsForm'),
ArgumentParams: () => import('./runnerDetail/argument-params.vue'),
TsFormInput: () => import('@/resources/plugins/TsForm/TsFormInput'),
+ TsFormRadio: () => import('@/resources/plugins/TsForm/TsFormRadio'),
+ TsFormItem: () => import('@/resources/plugins/TsForm/TsFormItem'),
+ TsFormSelect: () => import('@/resources/plugins/TsForm/TsFormSelect'),
RunnerGroupSetting: () => import('@/views/pages/autoexec/detail/actionDetail/runnergroup-setting.vue')
},
filters: {},
@@ -156,7 +204,40 @@ export default {
mappingMode: 'constant',
value: '-1'
},
- scriptId: null
+ scriptId: null,
+ roundCount: 32,
+ parallelCount: 64,
+ parallelPolicy: 'parallel',
+ parallelPolicyDataList: [
+ {
+ text: this.$t('page.autoexecparall'),
+ value: 'parallel'
+ },
+ {
+ text: this.$t('page.autoexecbatchround'),
+ value: 'roundCount'
+ }
+ ],
+ roundCountForm: {
+ placeholder: this.$t('page.selectinput'),
+ border: 'border',
+ dataList: this.getRoundCountList(),
+ filterName: 'text',
+ search: true,
+ transfer: true,
+ desc: this.$t('term.autoexec.roundcountdescrition'),
+ validateList: ['required']
+ },
+ parallelForm: {
+ placeholder: this.$t('page.selectinput'),
+ border: 'border',
+ dataList: this.getRoundCountList(),
+ filterName: 'text',
+ search: true,
+ transfer: true,
+ desc: this.$t('term.autoexec.paralldesc'),
+ validateList: ['required']
+ }
};
},
beforeCreate() {},
@@ -244,6 +325,9 @@ export default {
isValid = this.$refs.nameForm ? this.$refs.nameForm.valid() && isValid : isValid;
isValid = this.$refs.argumentConfig ? this.$refs.argumentConfig.valid() && isValid : isValid;
isValid = this.$refs.executeUser ? this.$refs.executeUser.valid() && isValid : isValid;
+ if ((this.$refs.roundCountForm && !this.$refs.roundCountForm.valid()) || (this.$refs.parallelForm && !this.$refs.parallelForm.valid())) {
+ isValid = false;
+ }
if (isValid) {
this.executeAction();
}
@@ -262,6 +346,12 @@ export default {
val.executeConfig = this.$refs.executeForm ? this.$refs.executeForm.getFormValue() : {};
if (this.targetShow) {
val.executeConfig.executeNodeConfig = this.$refs.addTarget.getValue();
+ val.parallelPolicy = this.parallelPolicy;
+ if (this.parallelPolicy === 'roundCount') {
+ val.roundCount = this.roundCount;
+ } else {
+ val.parallelCount = this.parallelCount;
+ }
} else {
val.executeConfig.executeNodeConfig = [];
}
@@ -321,6 +411,27 @@ export default {
}
});
}
+ },
+ getRoundCountList() {
+ let list = [
+ {
+ value: -1,
+ text: '蓝绿执行'
+ }
+ ];
+ list.push(...this.$utils.getRoundCountList());
+ return list;
+ },
+ changeParallelPolicy(val) {
+ if (val && val == 'roundCount') {
+ if (this.$utils.isEmpty(this.roundCount)) {
+ this.roundCount = 64;
+ }
+ } else {
+ if (this.$utils.isEmpty(this.parallelCount)) {
+ this.parallelCount = 32;
+ }
+ }
}
},
computed: {},
diff --git a/src/views/pages/cmdb/ci/attrhandler/input/table-attr.vue b/src/views/pages/cmdb/ci/attrhandler/input/table-attr.vue
index 8b6597c8abab83d5114e2fb2fb029f69c549f47e..b0e7d56fc3a09aab4c5c239bcb8b52062d9c043b 100644
--- a/src/views/pages/cmdb/ci/attrhandler/input/table-attr.vue
+++ b/src/views/pages/cmdb/ci/attrhandler/input/table-attr.vue
@@ -1,37 +1,39 @@
-
+
-
-
+
+ {{ $t('page.add') }}
+
+
+
+
{{ $t('term.cmdb.newcientity') }}
-
+
-
@@ -76,11 +78,11 @@ export default {
CiEntityChoose: () => import('../../../cientity/cientity-choose.vue')
},
props: {
- disabled: {type: Boolean, default: false},
- allowBatchAdd: {type: Boolean, default: true},
- attrData: {type: Object},
- valueList: {type: Array},
- attrEntity: {type: Object}
+ disabled: { type: Boolean, default: false },
+ allowBatchAdd: { type: Boolean, default: true },
+ attrData: { type: Object },
+ valueList: { type: Array },
+ attrEntity: { type: Object }
},
data() {
return {
@@ -89,15 +91,13 @@ export default {
暂存的选中值,包括选择值和添加值,最后会emit到外面的value中去,数据结构和cientity-list一致
*/
tmpValueList: [],
- ciEntityData: {theadList: [], tbodyList: []}
+ tbodyList: []
};
},
beforeCreate() {},
created() {},
beforeMount() {},
- mounted() {
- this.formatCiEntityData();
- },
+ mounted() {},
beforeUpdate() {},
updated() {},
activated() {},
@@ -105,17 +105,6 @@ export default {
beforeDestroy() {},
destroyed() {},
methods: {
- formatCiEntityData() {
- if (this.attrData.config.attrList) {
- const theadList = [{key: '_type', title: ''}];
- this.attrData.config.attrList.forEach(attr => {
- theadList.push({key: 'attr_' + attr.id, title: attr.label});
- });
- //增加一列操作列,可以删除配置项
- theadList.push({key: 'action'});
- this.ciEntityData.theadList = theadList;
- }
- },
selectCiEntity() {
if (!this.disabled) {
this.showSelectCiEntity = true;
@@ -153,52 +142,91 @@ export default {
}
this.dataList.splice(index, 1);
},
- valid() { //验证数据合法性
+ valid() {
+ //验证数据合法性
return true;
}
},
filter: {},
computed: {
- finalHeaderList: function() {
- let finalList = [];
- if (this.ciEntityData && this.ciEntityData.theadList && this.ciEntityData.theadList.length > 0) {
- this.ciEntityData.theadList.forEach(element => {
- if (element.key.indexOf('attr_') == 0 || element.key.indexOf('relto_') == 0 || element.key.indexOf('relfrom_') == 0) {
- finalList.push(element);
+ theadList() {
+ return [{ key: '_type', title: '' }, ...this.attrList, { key: 'action' }];
+ },
+ attrList() {
+ const theadList = [];
+ if (this.attrData.config.attrList) {
+ this.attrData.config.attrList.forEach(attr => {
+ if (attr.isSelected) {
+ theadList.push({ key: 'attr_' + attr.id, title: attr.label });
}
});
}
- return finalList;
+ return theadList;
}
},
watch: {
valueList: {
handler: function(val) {
if (val && val.length > 0) {
+ //排序参照
+ const idSortList = [];
+
+ const newCiEntityList = [];
//添加配置项
const newCiEntityIdList = [];
val.forEach(value => {
- if (this.ciEntityData.tbodyList.length == 0 || !this.ciEntityData.tbodyList.some(cientity => (cientity.id && value.id && cientity.id === value.id) || (cientity.uuid && value.uuid && cientity.uuid === value.uuid))) {
- if (typeof value == 'object') { //新添加的配置项
- this.ciEntityData.tbodyList.push(value);
- } else if (typeof value == 'string' || typeof value == 'number') {
- newCiEntityIdList.push(value);
+ if (typeof value === 'object' && !newCiEntityList.some(cientity => (cientity.id && value.id && cientity.id === value.id) || (cientity.uuid && value.uuid && cientity.uuid === value.uuid))) {
+ //新添加的配置项
+ this.$delete(value, '_selected');
+ this.$delete(value, 'isSelected');
+ newCiEntityList.push(value);
+ if (value.id) {
+ idSortList.push({ id: value.id });
+ } else if (value.uuid) {
+ idSortList.push({ uuid: value.uuid });
}
+ } else if (typeof value === 'number') {
+ newCiEntityIdList.push(value);
+ idSortList.push({ id: value });
}
});
- if (newCiEntityIdList.length) {
- this.$api.cmdb.cientity.getCiEntityByIdList(this.attrData.targetCiId, newCiEntityIdList).then(res => {
- if (res.Return && res.Return.length > 0) {
- res.Return.forEach(item => {
- this.ciEntityData.tbodyList.push(item);
+ if (newCiEntityIdList.length > 0) {
+ const attrList = [];
+ this.attrData.config.attrList.forEach(attr => {
+ if (attr.isSelected) {
+ attrList.push('attr_' + attr.id);
+ }
+ });
+ const searchParam = {
+ ciId: this.attrData.targetCiId,
+ idList: newCiEntityIdList,
+ showAttrRelList: attrList
+ };
+ this.$api.cmdb.cientity.searchCiEntity(searchParam).then(res => {
+ if (res.Return && res.Return.tbodyList && res.Return.tbodyList.length > 0) {
+ this.tbodyList = [...newCiEntityList, ...res.Return.tbodyList];
+
+ // 构建排序Map
+ const orderMap = new Map();
+ idSortList.forEach((item, idx) => {
+ if (item.id !== undefined) orderMap.set(`id:${item.id}`, idx);
+ if (item.uuid !== undefined) orderMap.set(`uuid:${item.uuid}`, idx);
+ });
+
+ // 排序
+ this.tbodyList.sort((a, b) => {
+ // 按优先顺序查找对应key
+ const aIdx = orderMap.get(`id:${a.id}`) ?? orderMap.get(`uuid:${a.uuid}`) ?? Infinity;
+ const bIdx = orderMap.get(`id:${b.id}`) ?? orderMap.get(`uuid:${b.uuid}`) ?? Infinity;
+ return aIdx - bIdx;
});
}
});
+ } else {
+ this.tbodyList = newCiEntityList;
}
- //删除配置项
- this.ciEntityData.tbodyList = this.ciEntityData.tbodyList.filter(cientity => { return val.some(value => { return (cientity.id && value.id && cientity.id === value.id) || (cientity.uuid && value.uuid && cientity.uuid === value.uuid); }); });
} else {
- this.ciEntityData.tbodyList = [];
+ this.tbodyList = [];
}
},
deep: true,
@@ -207,5 +235,4 @@ export default {
}
};
-
+
diff --git a/src/views/pages/cmdb/ci/attrhandler/view/table-attr.vue b/src/views/pages/cmdb/ci/attrhandler/view/table-attr.vue
index b85977c40552925e2874396f0a244a3e76747ea3..b88fdff0c27b8b584e57decf54347642cfd5695f 100644
--- a/src/views/pages/cmdb/ci/attrhandler/view/table-attr.vue
+++ b/src/views/pages/cmdb/ci/attrhandler/view/table-attr.vue
@@ -9,7 +9,7 @@
>
{{ value.name }}
-
+
-
+
{
+ globalAttrList.forEach((attr) => {
elementList.push({
typeText: this.$t('term.cmdb.globalattr'),
type: 'global',
@@ -574,11 +579,6 @@ export default {
return this.ciMap['ci' + ciId];
};
},
- getGlobalAttrById() {
- return attrId => {
- return this.globalMap[attrId];
- };
- },
getAttrById() {
return attrId => {
return this.attrMap[attrId];
@@ -589,20 +589,6 @@ export default {
return this.relMap[relId];
};
},
- getGlobalSelectConfig() {
- return id => {
- const globalAttr = this.getGlobalAttrById(id);
- if (globalAttr) {
- return {
- border: 'border',
- multiple: true,
- dataList: globalAttr.itemList,
- textName: 'value',
- valueName: 'id'
- };
- }
- };
- },
getRelSelectConfig() {
return id => {
const rel = this.getRelById(id);
diff --git a/src/views/pages/common/preview.vue b/src/views/pages/common/preview.vue
index c438d038e32e8dfdf410770696313bdeb0f5efed..2dcad4f1cd84af6445767d49221e3f84fe187ca8 100644
--- a/src/views/pages/common/preview.vue
+++ b/src/views/pages/common/preview.vue
@@ -47,7 +47,7 @@
-
+
diff --git a/src/views/pages/framework/notifyconfig/notifyconfig-manage.vue b/src/views/pages/framework/notifyconfig/notifyconfig-manage.vue
index 781f60fcf2d63d55199dc1b5f9d1875baae07fb4..825f53c01b81bf82e36ec00f99fbaf1305fe52e4 100644
--- a/src/views/pages/framework/notifyconfig/notifyconfig-manage.vue
+++ b/src/views/pages/framework/notifyconfig/notifyconfig-manage.vue
@@ -1,18 +1,16 @@
-
-
-
+
+
+
-
-
-
+
-
diff --git a/src/views/pages/framework/notifytactics/notifytactics-overview.vue b/src/views/pages/framework/notifytactics/notifytactics-overview.vue
index cedfb10fa6a8c499a6d40c29f67293f82126e99d..77ce57a8556fe9cc2501fd9463c366afc532ed8c 100644
--- a/src/views/pages/framework/notifytactics/notifytactics-overview.vue
+++ b/src/views/pages/framework/notifytactics/notifytactics-overview.vue
@@ -1,10 +1,9 @@
-
+
-
+
-
+ >
@@ -43,10 +41,7 @@
{{ $t('page.clicksetting') }}
-
+
@@ -72,7 +67,7 @@
- {{ row.lcd | formatDate }} {{ row.actionType }}
+ {{ row.lcd | formatDate }} {{ row.actionType }}
@@ -121,11 +116,7 @@
@on-ok="saveDefaultPolicy"
>
-
+
@@ -173,13 +164,17 @@ export default {
maxlength: 50,
width: '100%',
label: this.$t('page.name'),
- validateList: ['required', 'name-special', {
- name: 'searchUrl',
- url: 'api/rest/notify/policy/save',
- params: (value, rule) => {
- rule.url = this.isCopy ? 'api/rest/notify/policy/copy' : 'api/rest/notify/policy/save';
+ validateList: [
+ 'required',
+ 'name-special',
+ {
+ name: 'searchUrl',
+ url: 'api/rest/notify/policy/save',
+ params: (value, rule) => {
+ rule.url = this.isCopy ? 'api/rest/notify/policy/copy' : 'api/rest/notify/policy/save';
+ }
}
- }]
+ ]
}
],
defaultPolicyId: null,
@@ -200,7 +195,7 @@ export default {
textName: 'name',
search: true,
transfer: true,
- onChangelabel: (text) => {
+ onChangelabel: text => {
this.defaultPolicyFormSelectText = text;
}
}
@@ -210,7 +205,7 @@ export default {
created() {},
beforeMount() {},
mounted() {
- let {addNotify = false} = this.$route.query || {};
+ let { addNotify = false } = this.$route.query || {};
if (addNotify) {
this.tacticsDialog = true;
}
@@ -240,9 +235,7 @@ export default {
if (_this.handler) {
handlerList.forEach(item => {
if (item.children && item.children.length > 0) {
- let newObj = item.children.find(d =>
- d.value == _this.handler
- );
+ let newObj = item.children.find(d => d.value == _this.handler);
item.children.forEach(j => {
if (j.value == _this.handler && item.value == 'framework') {
if (j.isAllowMultiPolicy == 0) {
@@ -315,8 +308,8 @@ export default {
if (this.isShow) {
this.tacticsData.cardList.map(v => {
v.btnList = [
- {name: this.$t('page.reference'), value: 'ReferenceSelect', icon: '', type: 'ReferenceSelect', calleeType: 'notifypolicy', key: 'id'},
- {name: this.$t('page.delete'), value: 'del', type: 'del', icon: 'tsfont-trash-o', disable: true, text: this.$t('message.framework.notdelformtip'), key: 'referenceCount'},
+ { name: this.$t('page.reference'), value: 'ReferenceSelect', icon: '', type: 'ReferenceSelect', calleeType: 'notifypolicy', key: 'id' },
+ { name: this.$t('page.delete'), value: 'del', type: 'del', icon: 'tsfont-trash-o', disable: true, text: this.$t('message.framework.notdelformtip'), key: 'referenceCount' },
{
name: this.$t('term.framework.multi'),
value: 'dropdown',
@@ -332,8 +325,8 @@ export default {
} else {
this.tacticsData.cardList.map(v => {
v.btnList = [
- {name: this.$t('page.reference'), value: 'ReferenceSelect', icon: '', type: 'ReferenceSelect', calleeType: 'notifypolicy', key: 'id'},
- {name: this.$t('page.delete'), value: 'del', type: 'del', icon: 'tsfont-trash-o', disable: true, text: this.$t('message.framework.notdelformtip'), key: 'referenceCount'}
+ { name: this.$t('page.reference'), value: 'ReferenceSelect', icon: '', type: 'ReferenceSelect', calleeType: 'notifypolicy', key: 'id' },
+ { name: this.$t('page.delete'), value: 'del', type: 'del', icon: 'tsfont-trash-o', disable: true, text: this.$t('message.framework.notdelformtip'), key: 'referenceCount' }
];
});
}
@@ -431,7 +424,7 @@ export default {
}
this.$createDialog({
title: this.$t('dialog.title.deleteconfirm'),
- content: this.$t('dialog.content.deleteconfirm', {target: obj.name}),
+ content: this.$t('dialog.content.deleteconfirm', { target: obj.name }),
btnType: 'error',
'on-ok': vnode => {
let data = {
@@ -497,7 +490,9 @@ export default {
this.$addHistoryData('handler', val);
let handlerConfig = null;
this.handlerList.forEach(item => {
- if (item.value == val) { handlerConfig = item; }
+ if (item.value == val) {
+ handlerConfig = item;
+ }
});
if (val == 'framework') {
this.frameworkShow = false;
@@ -525,7 +520,6 @@ export default {
diff --git a/src/views/pages/report/statement/widgets/original/stackedbar-widget.vue b/src/views/pages/report/statement/widgets/original/stackedbar-widget.vue
index cbad51de8dcbbc786622df82ccc563fb55914fbe..75e1d339d89b5a6772d7f2c2a2c625daf3f28e1d 100644
--- a/src/views/pages/report/statement/widgets/original/stackedbar-widget.vue
+++ b/src/views/pages/report/statement/widgets/original/stackedbar-widget.vue
@@ -76,6 +76,8 @@ export default {
finalData() {
let data = [];
if (this.data && this.data.length > 0) {
+ //时间排序
+ this.data = this.data.sort((a, b) => this.changeString(b.yField) - this.changeString(a.yField));
//数据合并汇聚
this.data.forEach(d => {
const dd = data.find(dd => dd.yField == d.yField && dd.seriesField == d.seriesField);
diff --git a/src/views/pages/report/statement/widgets/widget-base.js b/src/views/pages/report/statement/widgets/widget-base.js
index 0b9d8fa436c7834779acb428bb8fb9ab3c01c523..7a20398aeeb341c0ee7f6963b6e07ddc169b96fe 100644
--- a/src/views/pages/report/statement/widgets/widget-base.js
+++ b/src/views/pages/report/statement/widgets/widget-base.js
@@ -65,7 +65,7 @@ export const WidgetBase = {
data.push(d);
});
}
- this.data = data;
+ this.data = data.sort((a, b) => this.changeString(a.xField) - this.changeString(b.xField));
if (!isFirstGetData) {
//第一次加载由于组件还没加载完毕,所以不需要调用changeData
this.changeData();
@@ -80,6 +80,21 @@ export const WidgetBase = {
}, this.widget.dataInterval * 1000);
}
});
+ },
+ changeString(a) { //字符串转时间戳
+ if (a) {
+ if (this.$utils.isValidDateTime(a)) {
+ return new Date(a).getTime();
+ } else if (this.$utils.isValidTimeString(a)) {
+ const pad = num => num.toString().padStart(2, '0');
+ const [h1, m1, s1 = '00'] = a.split(':').map(pad);
+ return `${h1}${m1}${s1}`;
+ } else if (typeof a === 'string') {
+ return a.charCodeAt(0);
+ }
+ return a;
+ }
+ return a;
}
},
beforeDestroy() {