联调服务器脚本策略剩余功能、脚本执行结果、AGENT更新模块

This commit is contained in:
康冉冉
2025-09-26 19:39:36 +08:00
parent 9f24b9f588
commit 3729bdda81
14 changed files with 527 additions and 301 deletions
+89 -89
View File
@@ -1,89 +1,89 @@
<template>
<div>
<template v-for="(item, index) in options">
<template v-if="values.includes(item.value)">
<span
v-if="(item.raw.listClass == 'default' || item.raw.listClass == '') && (item.raw.cssClass == '' || item.raw.cssClass == null)"
:key="item.value"
:index="index"
:class="item.raw.cssClass"
>{{ item.label + ' ' }}</span
>
<el-tag
v-else
:disable-transitions="true"
:key="item.value"
:index="index"
:type="item.raw.listClass == 'primary' ? '' : item.raw.listClass"
:class="item.raw.cssClass"
>
{{ item.label + ' ' }}
</el-tag>
</template>
</template>
<template v-if="unmatch && showValue">
{{ unmatchArray | handleArray }}
</template>
</div>
</template>
<script>
export default {
name: "DictTag",
props: {
options: {
type: Array,
default: null,
},
value: [Number, String, Array],
// 当未找到匹配的数据时,显示value
showValue: {
type: Boolean,
default: true,
},
separator: {
type: String,
default: ","
}
},
data() {
return {
unmatchArray: [], // 记录未匹配的项
}
},
computed: {
values() {
if (this.value === null || typeof this.value === 'undefined' || this.value === '') return []
return Array.isArray(this.value) ? this.value.map(item => '' + item) : String(this.value).split(this.separator)
},
unmatch() {
this.unmatchArray = []
// 没有value不显示
if (this.value === null || typeof this.value === 'undefined' || this.value === '' || this.options.length === 0) return false
// 传入值为数组
let unmatch = false // 添加一个标志来判断是否有未匹配项
this.values.forEach(item => {
if (!this.options.some(v => v.value === item)) {
this.unmatchArray.push(item)
unmatch = true // 如果有未匹配项,将标志设置为true
}
})
return unmatch // 返回标志的值
},
},
filters: {
handleArray(array) {
if (array.length === 0) return ''
return array.reduce((pre, cur) => {
return pre + ' ' + cur
})
},
}
}
</script>
<style scoped>
.el-tag + .el-tag {
margin-left: 10px;
}
</style>
<template>
<div>
<template v-for="(item, index) in options">
<template v-if="values.includes(item.value)">
<span
v-if="(item.raw.listClass == 'default' || item.raw.listClass == '') && (item.raw.cssClass == '' || item.raw.cssClass == null)"
:key="item.value"
:index="index"
:class="item.raw.cssClass"
>{{ item.label + ' ' }}</span
>
<el-tag
v-else
:disable-transitions="true"
:key="item.value"
:index="index"
:type="item.raw.listClass == 'primary' ? '' : item.raw.listClass"
:class="item.raw.cssClass"
>
{{ item.label + ' ' }}
</el-tag>
</template>
</template>
<template v-if="unmatch && showValue">
{{ unmatchArray | handleArray }}
</template>
</div>
</template>
<script>
export default {
name: "DictTag",
props: {
options: {
type: Array,
default: null,
},
value: [Number, String, Array],
// 当未找到匹配的数据时,显示value
showValue: {
type: Boolean,
default: true,
},
separator: {
type: String,
default: ","
}
},
data() {
return {
unmatchArray: [], // 记录未匹配的项
}
},
computed: {
values() {
if (this.value === null || typeof this.value === 'undefined' || this.value === '') return []
return Array.isArray(this.value) ? this.value.map(item => '' + item) : String(this.value).split(this.separator)
},
unmatch() {
this.unmatchArray = []
// 没有value不显示
if (this.value === null || typeof this.value === 'undefined' || this.value === '' || this.options.length === 0) return false
// 传入值为数组
let unmatch = false // 添加一个标志来判断是否有未匹配项
this.values.forEach(item => {
if (!this.options.some(v => v.value === item)) {
this.unmatchArray.push(item)
unmatch = true // 如果有未匹配项,将标志设置为true
}
})
return unmatch // 返回标志的值
},
},
filters: {
handleArray(array) {
if (array.length === 0) return ''
return array.reduce((pre, cur) => {
return pre + ' ' + cur
})
},
}
}
</script>
<style scoped>
.el-tag + .el-tag {
margin-left: 10px;
}
</style>
+16 -5
View File
@@ -1,6 +1,5 @@
<template>
<div>
{{config && config.key}}
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-width="config && config.labelWidth || '130px'" :key="config && config.key" class="demo-ruleForm">
<template v-for="(formItem,index) of formList">
<h4 v-if="formItem && formItem.config && formItem.config.title" class="form-header h4">{{formItem.config.title}}</h4>
@@ -84,7 +83,7 @@
<template v-else-if="formVal.type === 'date'">
<el-date-picker
v-model="ruleForm[key]"
:type="formVal.type || 'date'"
type="date"
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请输入${formVal.label}`"
:format="formVal.format || 'yyyy-MM-dd'"
@@ -92,10 +91,22 @@
></el-date-picker>
</template>
<template v-else-if="formVal.type === 'datetime'">
<el-date-picker
v-model="ruleForm[key]"
type="datetime"
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请输入${formVal.label}`"
:format="formVal.format || 'yyyy-MM-dd HH:mm:ss'"
:value-format="formVal.valueFormat || 'yyyy-MM-dd HH:mm:ss'"
@[formVal.eventName]="(val) => handleChange(key,val,formVal)"
></el-date-picker>
</template>
<template v-else-if="formVal.type === 'month'">
<el-date-picker
v-model="ruleForm[key]"
:type="formVal.type || 'date'"
type="month"
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
:format="formVal.format || 'yyyy-MM'"
:value-format="formVal.valueFormat || 'yyyy-MM'"
@@ -106,7 +117,7 @@
<template v-else-if="formVal.type === 'daterange'">
<el-date-picker
v-model="ruleForm[key]"
:type="formVal.type || 'date'"
type="daterange"
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
:format="formVal.format || 'yyyy-MM-dd'"
:value-format="formVal.valueFormat || 'yyyy-MM-dd'"
@@ -119,7 +130,7 @@
<template v-else-if="formVal.type === 'monthrange'">
<el-date-picker v-model="ruleForm[key]"
:type="formVal.type || 'date'"
type="monthrange"
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
:format="formVal.format || 'yyyy-MM'"
:value-format="formVal.valueFormat || 'yyyy-MM'"
+1 -1
View File
@@ -1,7 +1,7 @@
<template>
<div class="w100 h100">
<!-- 表格头部按钮 -->
<el-row :gutter="10" class="mb8">
<el-row :gutter="10" style="margin: 0 0 8px 0;">
<template v-if="config && config.tableButton && config.tableButton.top">
<el-col :span="1.5" v-for="item of config.tableButton.top">
<el-button :type="item.type" plain size="mini" :icon="item.icon" @click="handleClick(item,{})" :hasPermi="[item.hasPermi]">{{item.content}}</el-button>