feat(system): 新增产品线选择组件
- 重构 CsSelectOptionItemVo 类,改名为 CsSelectOptionVo - 新增 SystemComponentController 控制器,提供部门下拉选择数据源查询接口 - 新增 SystemProductLineVo 类,用于表示产品线选择框的选项 - 实现查询部门选择数据源的方法,构建产品线选择框的选项列表 - 新增前端 API 接口和组件以支持产品线选择功能 - 更新业务演示页面,添加产品线选择框
This commit is contained in:
@@ -12,9 +12,13 @@
|
||||
<el-form-item label="部门" prop="dept">
|
||||
<cute-dept-tree v-model="form.dept" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品线" prop="productLine">
|
||||
<cute-product-line-select v-model="form.productLine" @detail="onProductLineDetailChange" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">立即创建</el-button>
|
||||
<el-button>取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit('form')">提 交</el-button>
|
||||
<el-button type="danger" @click="onReset('form')">重 置</el-button>
|
||||
<el-button>取 消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -30,6 +34,12 @@
|
||||
</div>
|
||||
<cute-dept-tree @node-click="onDeptTreeNodeClick" @search="onDeptTreeSearch" />
|
||||
</el-card>
|
||||
<el-card style="margin-top: 10px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>产品线选择框</span>
|
||||
</div>
|
||||
<cute-product-line-select @change="onProductLineChange" @detail="onProductLineDetailChange" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -37,31 +47,49 @@
|
||||
|
||||
import CuteUserSelect from '@/views/components/business/CuteUserSelect.vue'
|
||||
import CuteDeptTree from '@/views/components/business/CuteDeptTree.vue'
|
||||
import CuteProductLineSelect from '@/views/components/business/CuteProductLineSelect.vue'
|
||||
|
||||
export default {
|
||||
name: 'CuteBusinessDemo',
|
||||
components: { CuteDeptTree, CuteUserSelect },
|
||||
components: { CuteProductLineSelect, CuteDeptTree, CuteUserSelect },
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
user: null,
|
||||
dept: null
|
||||
dept: null,
|
||||
productLine: null
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onUserSelectChange(data) {
|
||||
console.error('onUserSelectChange=', data)
|
||||
console.log('onUserSelectChange=', data)
|
||||
},
|
||||
onDeptTreeNodeClick(data) {
|
||||
console.error('onDeptTreeNodeClick=', data)
|
||||
console.log('onDeptTreeNodeClick=', data)
|
||||
},
|
||||
onSubmit() {
|
||||
console.error('this.form=', this.form)
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log('this.form=', this.form)
|
||||
} else {
|
||||
console.error('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
onReset(formName) {
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
onDeptTreeSearch(key) {
|
||||
console.error('onDeptTreeSearch:key', key)
|
||||
console.error('onDeptTreeSearch:form.dept', this.form.dept)
|
||||
console.log('onDeptTreeSearch:key', key)
|
||||
console.log('onDeptTreeSearch:form.dept', this.form.dept)
|
||||
},
|
||||
onProductLineChange(data) {
|
||||
console.log('onProductLineChange', data)
|
||||
},
|
||||
onProductLineDetailChange(data) {
|
||||
console.log('onProductLineDetailChange', data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,9 +545,9 @@ export default {
|
||||
handleWebSocketMessage(e) {
|
||||
const that = this
|
||||
const data = e.data
|
||||
// console.error('来自服务器的数据:data', data)
|
||||
// console.log('来自服务器的数据:data', data)
|
||||
const callbackData = JSON.parse(data)
|
||||
// console.error('callbackData', callbackData)
|
||||
// console.log('callbackData', callbackData)
|
||||
try {
|
||||
that.dynamicInstance = JSON.parse(callbackData.data)
|
||||
// 判断流水线是否结束
|
||||
@@ -607,9 +607,9 @@ export default {
|
||||
id: that.dynamicTemplate.id
|
||||
}
|
||||
try {
|
||||
if (that.dynamicHook) {
|
||||
clearInterval(that.dynamicHook)
|
||||
}
|
||||
// if (that.dynamicHook) {
|
||||
// clearInterval(that.dynamicHook)
|
||||
// }
|
||||
that.dynamicStartButtonLoading = true
|
||||
// 这里的 dynamicStartupStatus状态,需要后期与上下文关联后,初始化的时候带入最近一个流水线实例
|
||||
// let result
|
||||
|
||||
Reference in New Issue
Block a user