asd26269546 vor 1 Jahr
Ursprung
Commit
ab6b31cf95

+ 1 - 0
src/components/byTable/demo.vue

@@ -99,6 +99,7 @@ const sourceList = ref({
 		pageSize: 10,
 	},
 })
+
 const singleTable = ref({})
 const dialogVisible = ref(false)
 const modalType = ref('add')

+ 18 - 3
src/components/byTable/index.vue

@@ -230,7 +230,7 @@ import ElementsMapping from './ElementsMapping'
 import ComponentsMapping from './ComponentsMapping'
 import { computed, defineComponent, getCurrentInstance, ref,watch } from 'vue'
 import expand from './expand'
-
+import Sortable from 'sortablejs';
 export default defineComponent({
 	name: 'Table',
 	components: {
@@ -519,7 +519,18 @@ export default defineComponent({
 				}
 			}
 		}
-
+		const hocElTable = ref()
+		// const sortableInit = () => {
+		// 	console.log(hocElTable)
+		// 	const el = hocElTable.value.$el.querySelector('.el-table__body tbody')
+		// 	Sortable.create(el, {
+		// 		ghostClass: "sortableActive",
+		// 		onEnd(evt) {
+		// 			console.log(evt,proxy.source)
+		// 		}
+		// 	})
+		// }
+		
 		return {
 			getParent,
 			getPagination,
@@ -544,7 +555,8 @@ export default defineComponent({
 			statSelectVal,
 			statWarpHeight,
 			isMore,
-			changeStatData
+			changeStatData,
+			hocElTable
 		}
 	},
 })
@@ -570,6 +582,9 @@ export default defineComponent({
 }
 </style>
 <style lang="scss" scoped>
+.sortableActive{
+	background: #f5f7fa!important;
+}
 .show-more{
 	height: auto!important;
 }

+ 32 - 10
src/views/index.vue

@@ -90,7 +90,7 @@
 				</ul>
 			</div>
 		</div>
-		<!-- <byTableDemo></byTableDemo> -->
+		<byTableDemo></byTableDemo>
 		<!-- <el-input type="number" v-model='aaa' v-mousewheel></el-input> -->
 		<!-- 111112132131211 -->
 	</div>
@@ -119,15 +119,37 @@ const sendMegData = ref({
 	rows:[]
 })
 const pushProcessApproval = (row) => {
-	proxy.$router.replace({
-		path: "/platform_manage/process/processApproval",
-		query: {
-			flowKey: row.flowKey,
-			id: row.id,
-			processType:20,
-			version:row.version
-		},
-	});
+	if(row.status != 1 && row.status != 0) {
+		proxy.$router.push({
+			path: "/platform_manage/process/processApproval",
+			query: {
+				flowKey: row.flowKey,
+				id: row.id,
+				processType:20,
+				version:row.version
+			},
+		});
+		return
+	}
+	proxy.post('flowExample/getApprovalRecord',{id:row.id}).then(res=>{
+		if(res.recordList.length > 0) {
+			let data = res.recordList.filter(item => item.status === 2)
+			let nodeType= 0
+			if (data && data.length > 0) {
+				nodeType = data[0].nodeType
+			}
+			proxy.$router.push({
+				path: "/platform_manage/process/processApproval",
+				query: {
+					flowKey: row.flowKey,
+					id: row.id,
+					processType:nodeType == 1 ? 30 : 10,
+					version:row.version
+				},
+			});
+		}
+	})
+	
 }
 const { proxy } = getCurrentInstance();
 const getData = (() => {

+ 25 - 4
src/views/publicModule/codingRule/index.vue

@@ -9,8 +9,8 @@
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
         <template #ruleVoList>
           <div style="width: 100%">
-            <div v-if="formData.data.ruleVoList && formData.data.ruleVoList.length > 0">
-              <div style="display: flex; margin-bottom: 20px" v-for="(row, index) in formData.data.ruleVoList" :key="index">
+            <div v-if="formData.data.ruleVoList && formData.data.ruleVoList.length > 0" id="sort">
+              <div style="display: flex; margin-bottom: 20px" v-for="(row, index) in formData.data.ruleVoList" :key="index" ref="sort">
                 <el-form-item :prop="'ruleVoList.' + index + '.ruleType'" :rules="rules.ruleType" label="字符类型" prop="ruleType">
                   <el-select v-model="row.ruleType" placeholder="请选择字符类型" @change="changeType(row)">
                     <el-option v-for="item in ruleType" :key="item.value" :label="item.label" :value="item.value" />
@@ -72,7 +72,7 @@ import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { ElMessage } from "element-plus";
-
+import Sortable from 'sortablejs';
 const { proxy } = getCurrentInstance();
 const ruleType = ref([
   {
@@ -174,6 +174,7 @@ const config = computed(() => {
             el: "button",
             click() {
               update(row);
+              
             },
           },
         ];
@@ -181,6 +182,7 @@ const config = computed(() => {
     },
   ];
 });
+
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -270,7 +272,22 @@ const update = (row) => {
   formData.data = proxy.deepClone(row);
   loadingDialog.value = false;
   dialogVisible.value = true;
+  setTimeout(() => {
+    sortableInit()
+  }, 500);
 };
+const sort = ref()
+const sortableInit = () => {
+  console.log(document.getElementById('sort'))
+  const el = document.getElementById('sort');
+  Sortable.create(el, {
+    ghostClass: "sortableActive",
+    onEnd(evt) {
+      const { newIndex, oldIndex } = evt
+      formData.data.ruleVoList.splice(newIndex, 0, formData.data.ruleVoList.splice(oldIndex, 1)[0])
+    }
+  })
+}
 const clickAddRule = () => {
   if (formData.data.ruleVoList && formData.data.ruleVoList.length > 0) {
     formData.data.ruleVoList.push({
@@ -322,7 +339,11 @@ const getCodingKey = () => {
   return text;
 };
 </script>
-
+<style>
+  .sortableActive{
+    background: #e0dfdf;
+  }
+</style>
 <style lang="scss" scoped>
 .tenant {
   padding: 20px;