diff --git a/.beagle.yml b/.beagle.yml index 02b4fe6537c7189a1be5400e2b52203d7cbc2a98..8fd00e7b2665e9eb1d179b00eca4ffbefba25abb 100644 --- a/.beagle.yml +++ b/.beagle.yml @@ -1,10 +1,10 @@ # platform: # runner: 10.11.92.37 kind: pipeline -name: dev0508 +name: dev trigger: branch: - - dev0508 + - dev clone: disable: true @@ -65,7 +65,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 base: registry.cn-qingdao.aliyuncs.com/wod/nginx:1.19.5 # 基础镜像,根据项目需求进行使用,如果第三方登录改成ui-base dockerfile: .beagle/dockerfile repo: wod/apaas-system-ui # 生成镜像的 分组/名称 - version: "5.0.15" # 版本号 + version: "5.0.14" # 版本号 channel: amd64 args: "TARGETOS=linux,TARGETARCH=amd64" # 不同架构的构建参数 registry: registry.cn-qingdao.aliyuncs.com # 私有仓库地址 @@ -77,10 +77,10 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 - name: deploy-amd64 image: registry.cn-qingdao.aliyuncs.com/wod/devops-kubernetes:1.0 settings: - namespace: apaas-v5 + namespace: apaas-v5-demo deployment: apaas-manage-ui container: apaas-manage-ui - image: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.15-amd64 + image: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.14-amd64 environment: KUBERNETES_SERVER: from_secret: KUBERNETES_SERVER @@ -96,7 +96,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 base: registry.cn-qingdao.aliyuncs.com/wod/nginx:1.19.5-arm64 dockerfile: .beagle/dockerfile repo: wod/apaas-system-ui - version: "5.0.15" + version: "5.0.14" channel: arm64 args: "TARGETOS=linux,TARGETARCH=arm64" registry: registry.cn-qingdao.aliyuncs.com @@ -114,7 +114,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 base: registry.cn-qingdao.aliyuncs.com/wod/nginx:1.19.5-ppc64le dockerfile: .beagle/dockerfile repo: wod/apaas-system-ui - version: "5.0.15" + version: "5.0.14" channel: ppc64le args: "TARGETOS=linux,TARGETARCH=ppc64le" registry: registry.cn-qingdao.aliyuncs.com @@ -132,7 +132,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 base: registry.cn-qingdao.aliyuncs.com/wod/nginx:1.19.5-mips64le dockerfile: .beagle/dockerfile repo: wod/apaas-system-ui - version: "5.0.15" + version: "5.0.14" channel: mips64le args: "TARGETOS=linux,TARGETARCH=mips64le" registry: registry.cn-qingdao.aliyuncs.com @@ -145,8 +145,8 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker-manifest:1.0 settings: platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/mips64le - template: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.15-ARCH - target: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.15 + template: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.14-ARCH + target: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.14 username: from_secret: REGISTRY_USER_ALIYUN password: @@ -181,7 +181,7 @@ steps: REGISTRY_PASSWORD: from_secret: REGISTRY_PASSWORD_ALIYUN settings: - source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.15-amd64 + source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.14-amd64 target: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0-amd64 registry: registry.cn-qingdao.aliyuncs.com @@ -199,7 +199,7 @@ steps: REGISTRY_PASSWORD: from_secret: REGISTRY_PASSWORD_ALIYUN settings: - source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.15-arm64 + source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.14-arm64 target: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0-arm64 registry: registry.cn-qingdao.aliyuncs.com @@ -217,7 +217,7 @@ steps: REGISTRY_PASSWORD: from_secret: REGISTRY_PASSWORD_ALIYUN settings: - source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.15-ppc64le + source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.14-ppc64le target: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0-ppc64le registry: registry.cn-qingdao.aliyuncs.com @@ -235,7 +235,7 @@ steps: REGISTRY_PASSWORD: from_secret: REGISTRY_PASSWORD_ALIYUN settings: - source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.15-mips64le + source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.14-mips64le target: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0-mips64le ##--------------对于需要保密的信息隐藏,减少账户信息的泄密⬇-----------------## --- diff --git a/src/components/ability-card.vue b/src/components/ability-card.vue index 2ecfce6c953c8cc39b31e1e7475b7d3fb0089083..766e5572cccc5960bda7e28a355af63cd1292b69 100644 --- a/src/components/ability-card.vue +++ b/src/components/ability-card.vue @@ -2,25 +2,46 @@
删除
-
下移
-
上移
+
+ 下移 +
+
+ 上移 +
+ + v-model="checked" + @change="changeSelectedList">
- + {{ props.item.ability_name }} - {{ props.item.openness }} + {{ + props.item.openness + }} mock
@@ -33,7 +54,8 @@
阅读{{ - props.item.browse_count == 0 || (props.item.browse_count && props.item.browse_count < 10000) + props.item.browse_count == 0 || + (props.item.browse_count && props.item.browse_count < 10000) ? props.item.browse_count : props.item.browse_count < 10000000 ? Math.floor(props.item.browse_count / 10000) + "万+" @@ -53,7 +75,9 @@
-
+
{{ props.item.synopsis }}
@@ -68,8 +92,9 @@ diff --git a/src/page/main/home-config/recommend/edit/index.vue b/src/page/main/home-config/recommend/edit/index.vue index cfefb9f107551ed30ef671390161a8461d356385..62e247143d0ba98d9be58917eb6104834d53820f 100644 --- a/src/page/main/home-config/recommend/edit/index.vue +++ b/src/page/main/home-config/recommend/edit/index.vue @@ -11,14 +11,14 @@ @changeType="changeType">
- 已选择能力({{ selectArrNew.length }}/9) + 已选择能力({{ selectedItemList.length }}/9)
- +
@@ -97,13 +102,20 @@
已选择 - ({{ selectArrNew.length }}/9) + ({{ selectedItemList.length + toBeAddedItemList.length }}/9) 清空
- +
@@ -117,8 +129,8 @@ :pageSizes="[15, 30, 50]">
- 取 消 - 确 定 + 取 消 + 确 定
@@ -137,13 +149,14 @@ import abilityList from "@/components/ability-list.vue"; const router = useRouter(); const route = useRoute(); const typeFormRef = ref(null); +const abilityListRef = ref(null); const state = reactive({ formData: { business_type_id: "", logo: [], state: 1, }, - selectArr: ["", "", "", "", "", "", "", "", ""], + selectedItemList: [], selectDialog: false, dialogFilter: { openness: [], @@ -176,7 +189,8 @@ const state = reactive({ ], businessList: [], list: [], - selectArrNew: [], + abilityLoading: false, + toBeAddedItemList: [], }); const getDetail = (id) => { @@ -185,30 +199,25 @@ const getDetail = (id) => { .then((res) => { if (res.data.code == 200) { const data = res.data.data; - console.log(data); typeFormRef.value.setForm({ business_type_id: data.business_type_id, logo: data.logo ? [{ url: data.logo }] : [], }); - state.selectArr = []; - state.selectArrNew = []; + state.selectedItemList = []; + state.toBeAddedItemList = []; state.formData.state = data.state; state.formData.business_type_id = data.business_type_id; - state.selectArrNew = data.ability_list || []; - state.selectArrNew.forEach((e, i) => { + state.selectedItemList = data.ability_list || []; + state.selectedItemList.forEach((e, i) => { e.canDown = true; e.canUp = true; if (i == 0) { e.canUp = false; } - if (i == state.selectArrNew.length - 1) { + if (i == state.selectedItemList.length - 1) { e.canDown = false; } }); - state.selectArr.push(...state.selectArrNew); - for (var i = 0; i < 9 - state.selectArrNew.length; i++) { - state.selectArr.push(""); - } } else { ElMessage.error(res.data.data); } @@ -230,36 +239,33 @@ const getOrgList = () => { const changeType = (val) => { state.formData.business_type_id = val; - state.selectArr = ["", "", "", "", "", "", "", "", ""]; - state.selectArrNew = []; + state.selectedItemList = []; + state.toBeAddedItemList = []; }; const getAbilityList = () => { + state.abilityLoading = true; let params = { ...state.dialogFilter, business_type: state.formData.business_type_id, }; params.organization_id = - params.organization_id && params.organization_id.length > 0 ? params.organization_id.join(",") : ""; + params.organization_id && params.organization_id.length > 0 + ? params.organization_id.join(",") + : ""; params.openness = params.openness && params.openness.length > 0 ? params.openness.join(",") : ""; + axios.get(`/apaas/system/v5/recommend/ability/list`, { params }).then((res) => { if (res.data.code == 200) { + let selecteItemIdList = state.selectedItemList.map((e) => e.id); state.list = res.data.data.ability_list || []; - state.selectArrNew = []; - state.total = res.data.data.ability_total; - nextTick(() => { - state.list.forEach((e) => { - e.checked = false; - state.selectArr.forEach((k) => { - if (k.id) { - if (e.id == k.id) { - e.checked = true; - state.selectArrNew.push(e); - } - } - }); - }); + state.list.forEach((item) => { + if (selecteItemIdList.indexOf(item.id) > -1) { + item.isSelected = true; + } }); + state.total = res.data.data.ability_total; } + state.abilityLoading = false; }); }; @@ -269,58 +275,60 @@ const openDialog = () => { }; const deleteItem = (item) => { - changeCheck(item, true); + let selecteItemIdList = state.selectedItemList.map((e) => e.id); + state.selectedItemList.splice(selecteItemIdList.indexOf(item.id), 1); + + moveAbleChanging(); }; const move = (temp) => { let id = temp.item.id; let index = null; - state.selectArr.forEach((e, i) => { + state.selectedItemList.forEach((e, i) => { if (e.id == id) { index = i; } }); if (temp.type == 1) { - state.selectArr[index] = state.selectArr[index + 1]; - state.selectArr[index + 1] = temp.item; + state.selectedItemList[index] = state.selectedItemList[index + 1]; + state.selectedItemList[index + 1] = temp.item; } else { - state.selectArr[index] = state.selectArr[index - 1]; - state.selectArr[index - 1] = temp.item; + state.selectedItemList[index] = state.selectedItemList[index - 1]; + state.selectedItemList[index - 1] = temp.item; } - state.selectArr.forEach((e, i) => { + state.selectedItemList.forEach((e, i) => { if (e != "") { e.canDown = true; e.canUp = true; if (i == 0) { e.canUp = false; } - if (i == state.selectArrNew.length - 1) { + if (i == state.selectedItemList.length - 1) { e.canDown = false; } } }); - state.selectArrNew = state.selectArr.filter((e) => e ) }; const changePage = (val) => { - state.dialogFilter.page = 1; + state.dialogFilter.page = val; getAbilityList(); }; const changeSize = (val) => { state.dialogFilter.limit = val; - changePage(1); + changePage(val); }; const changeCollation = (val) => { state.dialogFilter.collation = val; - changePage(1); + changePage(val); }; const clearSelection = () => { - state.list.forEach((e) => { - e.checked = false; + state.toBeAddedItemList = []; + abilityListRef.value.itemRefs.forEach((item) => { + item.checked = false; }); - state.selectArrNew = []; }; const searchAction = () => { changePage(1); @@ -337,59 +345,73 @@ const clearAction = () => { changePage(1); }; -const changeCheck = (item, deleteFlag) => { - let arr = state.selectArrNew.map((e) => e.id) || []; - if (arr.indexOf(item.id) > -1) { - state.selectArrNew.splice(arr.indexOf(item.id), 1); +const changeSelectedList = (item, checked) => { + if (checked) { + state.toBeAddedItemList.push(item); } else { - state.selectArrNew.push(item); + let _toBeAddedItemIdList = state.toBeAddedItemList.map((e) => e.id); + state.toBeAddedItemList.splice(_toBeAddedItemIdList.indexOf(item.id), 1); } - state.selectArrNew.forEach((e, i) => { + moveAbleChanging(); +}; + +const moveAbleChanging = () => { + state.selectedItemList.forEach((e, i) => { e.canDown = true; e.canUp = true; if (i == 0) { e.canUp = false; } - if (i == state.selectArrNew.length - 1) { + if (i == state.selectedItemList.length - 1) { e.canDown = false; } }); - if (deleteFlag) { - conform(); - } }; + const submit = () => { typeFormRef.value.submitForm(); }; -const conform = () => { - if (state.selectArrNew.length > 9) { +const cancelSelectDialog = () => { + state.selectDialog = false; + state.toBeAddedItemList = []; + state.list = []; +}; + +const confirm = () => { + if ( + state.toBeAddedItemList.length > 9 || + state.selectedItemList.length + state.toBeAddedItemList.length > 9 + ) { ElMessage.error("最多可选择9个能力"); return; } - state.selectArr = JSON.parse(JSON.stringify(state.selectArrNew)); - if (state.selectArr.length < 9) { - let arr = []; - for (var i = 0; i < 9 - state.selectArr.length; i++) { - arr.push(""); + const _newItemList = []; + state.toBeAddedItemList.forEach((toBeAddedItem) => { + const hasItem = state.selectedItemList.some( + (selectedItem) => toBeAddedItem.id === selectedItem.id + ); + if (!hasItem) { + _newItemList.push(toBeAddedItem); } - state.selectArr.push(...arr); - } - state.selectDialog = false; + }); + state.selectedItemList.push(..._newItemList); + state.toBeAddedItemList.length = 0; + moveAbleChanging(); + cancelSelectDialog(); }; const submitFormData = (data) => { - if (state.selectArrNew.length < 6) { + if (state.selectedItemList.length < 6) { ElMessage.error("最少选择6个能力"); return; } if (data) { Object.assign(state.formData, data); - console.log(state.formData); if (route.query.id) { // 编辑 let abilitys = []; - state.selectArrNew.forEach((e) => { + state.selectedItemList.forEach((e) => { abilitys.push(e.ability_id); }); let params = { @@ -409,7 +431,7 @@ const submitFormData = (data) => { }); } else { let abilitys = []; - state.selectArrNew.forEach((e) => { + state.selectedItemList.forEach((e) => { abilitys.push(e.ability_id); }); let params = { @@ -461,16 +483,16 @@ onBeforeMount(() => { const { formData, - selectArr, + selectedItemList, selectDialog, dialogFilter, typeList, total, orgList, collationArr, - selection, list, - selectArrNew, + abilityLoading, + toBeAddedItemList, businessList, } = toRefs(state);