标签管理添加界面排序
Showing
2 changed files
with
36 additions
and
12 deletions
| ... | @@ -328,7 +328,7 @@ onMounted(() => { | ... | @@ -328,7 +328,7 @@ onMounted(() => { |
| 328 | <span v-if="item.unit">{{ item.unit }}</span> | 328 | <span v-if="item.unit">{{ item.unit }}</span> |
| 329 | </template> | 329 | </template> |
| 330 | <template #default="scope" v-else-if="item.type == 'switch'"> | 330 | <template #default="scope" v-else-if="item.type == 'switch'"> |
| 331 | <el-switch v-model="scope.row[item.field]" inline-prompt | 331 | <el-switch v-model="scope.row[item.field]" inline-prompt :key="scope.row.guid" |
| 332 | :disabled="!item.isDisabled ? false : item.isDisabled(scope)" :active-value="item.activeValue" | 332 | :disabled="!item.isDisabled ? false : item.isDisabled(scope)" :active-value="item.activeValue" |
| 333 | :inactive-value="item.inactiveValue" :width="item.switchWidth" :active-text="item.activeText" | 333 | :inactive-value="item.inactiveValue" :width="item.switchWidth" :active-text="item.activeText" |
| 334 | :inactive-text="item.inactiveText" :before-change="() => beforeChange(scope, item)" | 334 | :inactive-text="item.inactiveText" :before-change="() => beforeChange(scope, item)" | ... | ... |
| ... | @@ -49,6 +49,7 @@ const tableInfo = ref({ | ... | @@ -49,6 +49,7 @@ const tableInfo = ref({ |
| 49 | // multiple:true, | 49 | // multiple:true, |
| 50 | fields: [ | 50 | fields: [ |
| 51 | { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, | 51 | { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, |
| 52 | { label: "界面排序", field: "orderNum", width: 90, align: "center" }, | ||
| 52 | { label: "标签名称", field: "labelName", width: 140 }, | 53 | { label: "标签名称", field: "labelName", width: 140 }, |
| 53 | { label: "标签类型", field: "labelTypeName", width: 140 }, | 54 | { label: "标签类型", field: "labelTypeName", width: 140 }, |
| 54 | { label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '禁用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center' }, | 55 | { label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '禁用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center' }, |
| ... | @@ -76,6 +77,11 @@ const tableInfo = ref({ | ... | @@ -76,6 +77,11 @@ const tableInfo = ref({ |
| 76 | const detail = res.data || {}; | 77 | const detail = res.data || {}; |
| 77 | currTableData.value = Object.assign({}, currTableData.value, detail); | 78 | currTableData.value = Object.assign({}, currTableData.value, detail); |
| 78 | newCreateLabelFormItems.value.forEach(item => { | 79 | newCreateLabelFormItems.value.forEach(item => { |
| 80 | if (item.children?.length) { | ||
| 81 | item.children.forEach(child => child.default = detail[child.field]); | ||
| 82 | } else { | ||
| 83 | item.default = detail[item.field]; | ||
| 84 | } | ||
| 79 | item.default = detail[item.field]; | 85 | item.default = detail[item.field]; |
| 80 | }); | 86 | }); |
| 81 | let labelRuleField = detail.labelRuleField || {}; | 87 | let labelRuleField = detail.labelRuleField || {}; |
| ... | @@ -225,6 +231,11 @@ const newCreateLabelFormItems = ref<any>([{ | ... | @@ -225,6 +231,11 @@ const newCreateLabelFormItems = ref<any>([{ |
| 225 | visible: true, | 231 | visible: true, |
| 226 | }, | 232 | }, |
| 227 | { | 233 | { |
| 234 | label: ' ', | ||
| 235 | type: 'select-group', | ||
| 236 | placeholder: '请选择', | ||
| 237 | field: 'labelgroup', | ||
| 238 | children: [{ | ||
| 228 | label: '标签类型', | 239 | label: '标签类型', |
| 229 | type: 'select', | 240 | type: 'select', |
| 230 | placeholder: '请选择', | 241 | placeholder: '请选择', |
| ... | @@ -239,6 +250,16 @@ const newCreateLabelFormItems = ref<any>([{ | ... | @@ -239,6 +250,16 @@ const newCreateLabelFormItems = ref<any>([{ |
| 239 | filterable: true, | 250 | filterable: true, |
| 240 | clearable: true, | 251 | clearable: true, |
| 241 | visible: true, | 252 | visible: true, |
| 253 | }, { | ||
| 254 | label: '界面排序', | ||
| 255 | type: 'input', | ||
| 256 | placeholder: '请输入', | ||
| 257 | field: 'orderNum', | ||
| 258 | maxlength: 6, | ||
| 259 | regexp: /\D/g, | ||
| 260 | required: false, | ||
| 261 | clearable: true, | ||
| 262 | }], | ||
| 242 | }, { | 263 | }, { |
| 243 | type: 'radio-group', | 264 | type: 'radio-group', |
| 244 | label: '规则配置', | 265 | label: '规则配置', |
| ... | @@ -254,7 +275,7 @@ const newCreateLabelFormItems = ref<any>([{ | ... | @@ -254,7 +275,7 @@ const newCreateLabelFormItems = ref<any>([{ |
| 254 | 275 | ||
| 255 | const newCreateLabelFormRules = ref({ | 276 | const newCreateLabelFormRules = ref({ |
| 256 | labelName: [required('请输入标签名称')], | 277 | labelName: [required('请输入标签名称')], |
| 257 | labelTypeCode: [required('请选择标签类型')], | 278 | labelTypeCode: [required('请选择标签类型')] |
| 258 | }); | 279 | }); |
| 259 | 280 | ||
| 260 | const ruleContentFormRef = ref(); | 281 | const ruleContentFormRef = ref(); |
| ... | @@ -299,6 +320,7 @@ const newCreateLabelDialogInfo = ref({ | ... | @@ -299,6 +320,7 @@ const newCreateLabelDialogInfo = ref({ |
| 299 | let submitLabel = () => { | 320 | let submitLabel = () => { |
| 300 | let params = Object.assign({}, info, { | 321 | let params = Object.assign({}, info, { |
| 301 | bizState: 'Y', | 322 | bizState: 'Y', |
| 323 | orderNum: info.orderNum != null ? parseInt(info.orderNum) : null, | ||
| 302 | labelRuleField: { | 324 | labelRuleField: { |
| 303 | matchChValue: matchChValue.value.value, | 325 | matchChValue: matchChValue.value.value, |
| 304 | matchEnValue: matchEnValue.value.value, | 326 | matchEnValue: matchEnValue.value.value, |
| ... | @@ -432,11 +454,16 @@ const tabChange = (val) => { | ... | @@ -432,11 +454,16 @@ const tabChange = (val) => { |
| 432 | 454 | ||
| 433 | const handleCreate = () => { | 455 | const handleCreate = () => { |
| 434 | newCreateLabelFormItems.value.forEach(item => { | 456 | newCreateLabelFormItems.value.forEach(item => { |
| 457 | if (item.children?.length) { | ||
| 458 | item.children[0].default = '' | ||
| 459 | item.children[1].default = '' | ||
| 460 | } else { | ||
| 435 | if (item.field == 'matchType') { | 461 | if (item.field == 'matchType') { |
| 436 | item.default = 1; | 462 | item.default = 1; |
| 437 | } else { | 463 | } else { |
| 438 | item.default = ''; | 464 | item.default = ''; |
| 439 | } | 465 | } |
| 466 | } | ||
| 440 | }); | 467 | }); |
| 441 | matchChValue.value.value = ''; | 468 | matchChValue.value.value = ''; |
| 442 | matchChValue.value.disabled = false; | 469 | matchChValue.value.disabled = false; |
| ... | @@ -602,8 +629,8 @@ onBeforeMount(() => { | ... | @@ -602,8 +629,8 @@ onBeforeMount(() => { |
| 602 | }).then((res: any) => { | 629 | }).then((res: any) => { |
| 603 | if (res.code == proxy.$passCode) { | 630 | if (res.code == proxy.$passCode) { |
| 604 | labelTypeList.value = res.data || []; | 631 | labelTypeList.value = res.data || []; |
| 605 | let item = newCreateLabelFormItems.value.find(item => item.field == 'labelTypeCode'); | 632 | let item = newCreateLabelFormItems.value.find(item => item.field == 'labelgroup'); |
| 606 | item && (item.options = labelTypeList.value); | 633 | item && (item.children[0].options = labelTypeList.value); |
| 607 | } else { | 634 | } else { |
| 608 | proxy.$ElMessage.error(res.msg); | 635 | proxy.$ElMessage.error(res.msg); |
| 609 | } | 636 | } |
| ... | @@ -652,12 +679,10 @@ onBeforeMount(() => { | ... | @@ -652,12 +679,10 @@ onBeforeMount(() => { |
| 652 | </span> | 679 | </span> |
| 653 | </div> | 680 | </div> |
| 654 | <div class="v-match"> | 681 | <div class="v-match"> |
| 655 | <el-input v-model="matchChValue.value" maxlength="200" | 682 | <el-input v-model="matchChValue.value" maxlength="200" style="width: 272px;height:94px;" show-word-limit |
| 656 | style="width: 272px;height:94px;" show-word-limit type="textarea" class="no-resize" | 683 | type="textarea" class="no-resize" placeholder="请输入字段中文" /> |
| 657 | placeholder="请输入字段中文" /> | 684 | <el-input v-model="matchEnValue.value" maxlength="200" style="width: 272px;height:94px;" show-word-limit |
| 658 | <el-input v-model="matchEnValue.value" maxlength="200" | 685 | type="textarea" class="no-resize" placeholder="请输入字段英文" /> |
| 659 | style="width: 272px;height:94px;" show-word-limit type="textarea" class="no-resize" | ||
| 660 | placeholder="请输入字段英文" /> | ||
| 661 | </div> | 686 | </div> |
| 662 | </div> | 687 | </div> |
| 663 | <div class="dim-label" style="margin-top: 16px;"> | 688 | <div class="dim-label" style="margin-top: 16px;"> |
| ... | @@ -684,8 +709,7 @@ onBeforeMount(() => { | ... | @@ -684,8 +709,7 @@ onBeforeMount(() => { |
| 684 | <el-input v-model="row.matchValue" class="v-input" placeholder="请输入匹配值" /> | 709 | <el-input v-model="row.matchValue" class="v-input" placeholder="请输入匹配值" /> |
| 685 | 710 | ||
| 686 | <!-- 删除按钮 --> | 711 | <!-- 删除按钮 --> |
| 687 | <el-button class="extra-icon" :icon="Delete" @click="deleteRow(index)" circle | 712 | <el-button class="extra-icon" :icon="Delete" @click="deleteRow(index)" circle style="margin-left: 8px;" /> |
| 688 | style="margin-left: 8px;" /> | ||
| 689 | </div> | 713 | </div> |
| 690 | </div> | 714 | </div> |
| 691 | 715 | ... | ... |
-
Please register or sign in to post a comment