|
@@ -0,0 +1,171 @@
|
|
|
+<!--<template>
|
|
|
+
|
|
|
+ <avue-form :option="option"
|
|
|
+ v-model="form">
|
|
|
+ <template #input="{row}">
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+</template>
|
|
|
+<script ssetup lang="ts">
|
|
|
+ export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ form: {
|
|
|
+ dynamic: [{
|
|
|
+ input: 1,
|
|
|
+ select: 1
|
|
|
+ }, {
|
|
|
+ input: 2,
|
|
|
+ select: 2
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ option: {
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '技能',
|
|
|
+ prop: 'dynamic',
|
|
|
+ type: 'dynamic',
|
|
|
+ span: 24,
|
|
|
+ children: {
|
|
|
+ align: 'center',
|
|
|
+ headerAlign: 'center',
|
|
|
+ rowAdd: (done) => {
|
|
|
+ this.$message.success('新增回调');
|
|
|
+ done({
|
|
|
+ input: '默认值'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ rowDel: (row, done) => {
|
|
|
+ this.$message.success('删除回调' + JSON.stringify(row));
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ column: [{
|
|
|
+ label: '选择框',
|
|
|
+ prop: "select",
|
|
|
+ type: 'select',
|
|
|
+ dicData: [{
|
|
|
+ label: '测试1',
|
|
|
+ value: 1
|
|
|
+ }, {
|
|
|
+ label: '测试2',
|
|
|
+ value: 2
|
|
|
+ }]
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ addAll () {
|
|
|
+ for (let i = 0; i < 10; i++) {
|
|
|
+ this.form.dynamic.push({
|
|
|
+ input: 1,
|
|
|
+ select: 1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>-->
|
|
|
+
|
|
|
+<template>
|
|
|
+<avue-form :option="option"
|
|
|
+ v-model="form">
|
|
|
+ <template #input="{row}">
|
|
|
+
|
|
|
+ </template>
|
|
|
+</avue-form>
|
|
|
+</template>
|
|
|
+<script setup lang="ts">
|
|
|
+ import { ref, getCurrentInstance } from "vue";
|
|
|
+ import { useCrud } from "@/hooks/userCrud";
|
|
|
+ import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
+ import { useCommonStoreHook } from "@/store";
|
|
|
+
|
|
|
+ const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
+ import { useDictionaryStoreHook } from "@/store";
|
|
|
+ const { dicts } = useDictionaryStoreHook();
|
|
|
+ import {
|
|
|
+ addStationDevice,
|
|
|
+ } from "@/api/station";
|
|
|
+ const test = () => {
|
|
|
+ isShowTable.value = true;
|
|
|
+ tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
+ };
|
|
|
+ const props = defineProps({
|
|
|
+ postId: {
|
|
|
+ type: Number,
|
|
|
+ default: () => {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ watch?.(
|
|
|
+ () => props.postId,
|
|
|
+ (newVal: string) => {
|
|
|
+ search.value.postId = newVal
|
|
|
+ dataList()
|
|
|
+ }
|
|
|
+ );
|
|
|
+ // 传入一个url,后面不带/
|
|
|
+ const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
+ useCrud({
|
|
|
+ src: "/api/v1/sys/postSkill",
|
|
|
+ });
|
|
|
+ const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
+ Methords; //增删改查
|
|
|
+ const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
+ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
+ // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
|
|
|
+ // const permission = reactive({
|
|
|
+ // delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
|
|
|
+ // addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
|
|
|
+ // editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
|
+ // menu: true,
|
|
|
+ // });
|
|
|
+ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ // console.log("crudRef", crudRef)
|
|
|
+ dataList();
|
|
|
+ });
|
|
|
+ /* const form=ref({
|
|
|
+ dynamic: [{
|
|
|
+ input: 1,
|
|
|
+ select: 1
|
|
|
+ }, {
|
|
|
+ input: 2,
|
|
|
+ select: 2
|
|
|
+ }]
|
|
|
+ });*/
|
|
|
+ // 设置表格列或者其他自定义的option
|
|
|
+ option.value = Object.assign(option.value, {
|
|
|
+ column: [
|
|
|
+ {label: '技能',
|
|
|
+ prop: 'dynamic',
|
|
|
+ type: 'dynamic',
|
|
|
+ span: 24,
|
|
|
+ children: {
|
|
|
+ align: 'center',
|
|
|
+ type: 'form',
|
|
|
+ headerAlign: 'center',
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "技能",
|
|
|
+ prop: "skill_dict_value",
|
|
|
+ type: 'select',
|
|
|
+ dicData:dicts.skill_type,
|
|
|
+ props: { label: "dictLabel", value: "dictValue" },
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ });
|
|
|
+
|
|
|
+</script>
|